Page 1 of 1

is this possible

Posted: Thu Sep 20, 2012 9:54 am
by shakeeb ahmed
:ugeek: well here is something i have been looking for well i have designed a report in designer and have named all the fields as such {sp_CustomForms_UCAF.ProviderName} where sp_CustomForms_UCAF is supposed to be the name of the data source in the report and "ProviderName" as the column name now what i want to do is to pass the values for these columns from the source of my project in the shape of a sql dataset hence making this much more usable for us. i am attaching the report here please guide me how it is possible . my manager has asked me to do something like it happened in Crystal reports design in the designer and pass data from the source please help in this issue.

Re: is this possible

Posted: Thu Sep 20, 2012 12:18 pm
by Alex K.
Hello,

You can use the following code.
New connection string:

Code: Select all

report.Dictionary.Databases.Clear();
report.Dictionary.Databases.Add(new Stimulsoft.Report.Dictionary.StiSqlDatabase("Connection", newConnectionString));
Add DataSources:

Code: Select all

StiSqlSource DS1 = new StiSqlSource("Connection", "DS1", "DS1", "SELECT * FROM DS1", true, false);
report.Dictionary.DataSources.Add(DS1);
Add Columns:

Code: Select all

foreach (DataColumn col in dataTableDS1.Columns)
{
     DS1.Columns.Add(col.ColumnName, col.DataType);
}
Thank you.

Re: is this possible

Posted: Sat Sep 22, 2012 6:39 am
by shakeeb ahmed
Can i Add a Sql Dataset in StiSqlSource or can i execute a stored procedure and pass parameters instead of using a select command ??

Re: is this possible

Posted: Sat Sep 22, 2012 9:29 am
by shakeeb ahmed
this all is done but how can i bind data with it via a dataset when report has to be viewed

Re: is this possible

Posted: Sat Sep 22, 2012 10:18 am
by shakeeb ahmed
remember that in my report the fields are done as "{sp_CustomForms_UCAF.AccountName}" so the name of the datasource should be -sp_CustomForms_UCAF and i am till now doing the following it is opening the report in reportviewer without loading loading any data please help

sp_CustomForms is the dataset which contains the feilds and data

Dim Con As String = "Data Source=.;Initial Catalog=Standard_Hospital; Asynchronous Processing=true ;User ID=sa"

Rep.Dictionary.Databases.Clear()
Rep.Dictionary.Databases.Add(New Stimulsoft.Report.Dictionary.StiSqlDatabase("Connection", Con))

Dim sp_CustomForms_UCAF = New StiSqlSource("Connection", "sp_CustomForms_UCAF", "sp_CustomForms_UCAF", "execute sp_CustomForms_UCAF", True, False)
Rep.Dictionary.DataSources.Add(sp_CustomForms_UCAF)

For Each col In sp_CustomForms.Columns

sp_CustomForms_UCAF.Columns.Add(col.ColumnName, col.DataType)

Next

Rep.RegData("Connection", ds)
Rep.Compile()

Me.StiWebViewer1.Report = Rep

Re: is this possible

Posted: Mon Sep 24, 2012 7:13 am
by Alex K.
Hello,

Sorry, maybe we did not exactly understand your question. Could you explain your issue in more details?

Thank you.