greetingz,
i would really need some help with parameter passing, i spent my whole day searching for a solution but no dice. i never used these business intelligence reports before so i only know a fhew basic thigs.
i managed to make a report, but the sql querys require a parameter as input. now this would be unacceptable, i cant expect the user to fill it in every time he wants a report of a bill. so i have a gridview with some filterable data, and when the user selects a row i want the row's specific col entry to be passed to the report on a new page as a parameter
i saw some people say that i can pass this in the URL with ¶mname=x/y/z, yea life never went easy on me so of course it must requre some settings that i dont know how to do
i would prefer to pass things in code as some report parameter but i dont even know how or where i would begin with that
for example here's a query
1Select2case szf_fizmod3when 1then'átutalás'4when 0then'Készpénz'5end as'Fizetési mód',6 szf_teljdatas'Teljesítés ideje', szf_szkelteas'Sámla kelte', szf_fizhatidoas'Fizetési határid?', szf_szamas'Számlasorszám', szf_megjas Megjegyzés78from szamlafej9where szf_szamlike @.szamnow i would need the @.szam to be populated for it to give back anything
thanks
If you run it in an ASP.NET page you can use code like mine:
protected void Page_Init(object sender, EventArgs e)
{
if (!Page.IsPostBack)
{
// Set the processing mode for the ReportViewer to Remote
reportViewer.ProcessingMode = ProcessingMode.Remote; //ProcessingMode="Remote"
ServerReport serverReport = reportViewer.ServerReport;
// Set the report server URL and report path
NameValueCollection appSettings = WebConfigurationManager.AppSettings as NameValueCollection;
serverReport.ReportServerUrl = new Uri(appSettings["SSRSReportServer"]);
serverReport.ReportPath = "/OTDReports/OTDMain";
// Create the parameters
ReportParameter FromDate = new ReportParameter(); FromDate.Name = "FromDate";
FromDate.Values.Add(Request["TextBoxFromDate"]); FromDate.Visible = false;
ReportParameter ToDate = new ReportParameter(); ToDate.Name = "ToDate";
ToDate.Values.Add(Request["TextBoxToDate"]); ToDate.Visible = false;
ReportParameter HrefBase = new ReportParameter(); HrefBase.Name = "HrefBase";
HrefBase.Values.Add("http://" + Request.ServerVariables["SERVER_NAME"] + Request.ServerVariables["URL"].Remove(Request.ServerVariables["URL"].LastIndexOf("/")));
HrefBase.Visible = false;
reportViewer.ServerReport.SetParameters(new ReportParameter[] { FromDate, ToDate , HrefBase });
}
}
ahh thankyou,
now my question is, when i try to load the page i get an error saying i'm not authorised to view the report server due to insufficient credentials. i searched around the forums and found which seems like a solution
ReportingService rs = new ReportingService();
rs.Credentials = System.Net.CredentialCache.DefaultCredentials;
only problem is, it doesnt know what ReportingService is, but i searched in the help and it seems its under system.web.services(.soaphttpclient) which is in the references, but still no dice
This a security issue!
You should stay with only windows authorisation in your website
I do nothing for credentials and every thing works fine.
|||the site would work like at the login page the user logs in to a sql account on the sql server, and this account would determine what he can do on the page and i thought i'll set the report viewing like this also, so this is not supported, or just comes with too much fuss?
No comments:
Post a Comment