我正在尝试使用sspyrs下载SSRS报告,但出现错误:“没有可用的有效导出链接”
这是我尝试过的:
import sspyrs
myrpt = sspyrs.report(r'http://10.168.2.245:9081/reports/report/SKF%20Stock%20Report(1)','myusername','mypass')
myrpt.directdown('F:\myfile', 'Excel')
我在做什么错? 还有其他办法吗?
答案 0 :(得分:0)
示例:
from requests import Session
host = 'https://cloud.digitalocean.com'
login_uri = '/login'
target_uri = '/projects'
s = Session()
s.auth = ('username', 'password')
s.get(host + login_uri)
r = s.get(host + target_uri)
r.raise_for_status()
print(len(r.content))
答案 1 :(得分:0)
这可能不是合适的方法,但目前已经解决了我的问题
from django.contrib.auth import get_user_model
something=models.ForeignKey(
get_user_model(),
related_name='something',
on_delete=models.CASCADE,
db_column='username',
to_field='username'
)
from selenium import webdriver
options = webdriver.ChromeOptions()
更改下载目录
options.add_argument("--start-maximized")
prefs = {"profile.default_content_settings.popups": 0,"download.default_directory": r'F:\Reports\'',"directory_upgrade": True}
options.add_experimental_option("prefs", prefs)
传递用户名和密码(用户名:密码)通过URL并在Excel中呈现报告(&rs%3AFormat = Excel)
driver=webdriver.Chrome(r'C:\Users\Alim\Downloads\chromedriver_win32\chromedriver.exe', options=options)