Page 1 of 1

accessing parameters for a web report

Posted: Wed May 09, 2007 2:12 pm
by LenaB
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


accessing parameters for a web report

Posted: Thu May 10, 2007 10:27 am
by LenaB
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

accessing parameters for a web report

Posted: Thu May 10, 2007 10:36 am
by Edward
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:

Code: Select all

stiReport1.CompiledReport.DataSources("QCDocs").Parameters(1).Type
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.

accessing parameters for a web report

Posted: Wed May 16, 2007 5:32 pm
by LenaB
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



accessing parameters for a web report

Posted: Wed May 16, 2007 6:12 pm
by Vital
You can use following code:

Code: Select all

stiReport1.CompiledReport.Dictionary.Databases.Clear();
stiReport1.CompiledReport.Dictionary.Databases.Add(new StiSqlDatabase("NameOfYourDatabase", ConnectionString);
Thank you.

accessing parameters for a web report

Posted: Wed May 16, 2007 10:05 pm
by LenaB
Thank you so much for your prompt reply

Lena

accessing parameters for a web report

Posted: Fri May 18, 2007 5:01 am
by Guest
If you have any suggestions or questions do not hesitate to write us.

Thank you.