accessing parameters for a web report
accessing parameters for a web report
Hi
I have to know what parameters a report requires and then send those parameters to the report.
I can set up a report with un named parameters but how do I access then in my code.
If I set up an unnamed parameter called "para1" as a date type for a connection called "Connection" for a data source called "QCDocs" in report STIReport1
then in my page load I have the code:
inputType= stiReport1. ?? to get the types of parametes
i input the data
on button click to print report event :
StiReport1.GlobalizationStrings.LocalizeReport(LangCode)
StiReport1. ???? = inpDate.toShortDateString
StiWebViewer1.Report = StiReport1
Thanks for your time
Lena
I have to know what parameters a report requires and then send those parameters to the report.
I can set up a report with un named parameters but how do I access then in my code.
If I set up an unnamed parameter called "para1" as a date type for a connection called "Connection" for a data source called "QCDocs" in report STIReport1
then in my page load I have the code:
inputType= stiReport1. ?? to get the types of parametes
i input the data
on button click to print report event :
StiReport1.GlobalizationStrings.LocalizeReport(LangCode)
StiReport1. ???? = inpDate.toShortDateString
StiWebViewer1.Report = StiReport1
Thanks for your time
Lena
accessing parameters for a web report
Ok so I figured out from various examples that I
have to
stiReport1.compile()
stiReport1.CompiledReport.DataSources("QCDocs").Parameters(1).ParameterValue= xxx
will get the data INTO the report
But where do I find the list of parameters and and their data types?
Lena
have to
stiReport1.compile()
stiReport1.CompiledReport.DataSources("QCDocs").Parameters(1).ParameterValue= xxx
will get the data INTO the report
But where do I find the list of parameters and and their data types?
Lena
accessing parameters for a web report
You are absolutely correct.
Each parameter has a name. It is doesn't matter is it named or unnamed parameter. You can get the parameter via its index or by its name.
The type of the parameter you can get in the following way:
The list of the Parameters of the DataSource QCDocs
is stiReport1.CompiledReport.DataSources("QCDocs").Parameters
so please scan all DataSources and you can get full list of the Parameters in the report.
Thank you.
Each parameter has a name. It is doesn't matter is it named or unnamed parameter. You can get the parameter via its index or by its name.
The type of the parameter you can get in the following way:
Code: Select all
stiReport1.CompiledReport.DataSources("QCDocs").Parameters(1).Type
is stiReport1.CompiledReport.DataSources("QCDocs").Parameters
so please scan all DataSources and you can get full list of the Parameters in the report.
Thank you.
accessing parameters for a web report
Hi
That works great!
Thank you
Now I realize that every report has to have a unique connection string because of the passwords and permissions
connections strings are in the dictionary and associated with a database. It is an SQL database.
stiReport1.CompiledReport.Dictionary.Databases(0)
is as far as I can get in finding where the connection string is stored
Thanks for your help.
Lena
That works great!
Thank you
Now I realize that every report has to have a unique connection string because of the passwords and permissions
connections strings are in the dictionary and associated with a database. It is an SQL database.
stiReport1.CompiledReport.Dictionary.Databases(0)
is as far as I can get in finding where the connection string is stored
Thanks for your help.
Lena
accessing parameters for a web report
You can use following code:
Thank you.
Code: Select all
stiReport1.CompiledReport.Dictionary.Databases.Clear();
stiReport1.CompiledReport.Dictionary.Databases.Add(new StiSqlDatabase("NameOfYourDatabase", ConnectionString);
accessing parameters for a web report
Thank you so much for your prompt reply
Lena
Lena
accessing parameters for a web report
If you have any suggestions or questions do not hesitate to write us.
Thank you.
Thank you.