The xsd provides two things.
First, the thing to design the report off of.
Second, the thing to put the data into (in a specfic format).
Whenever you create a report , you call it something.
EmployeeByDepartmentReport (.rpt). This becomes a real "object", that you
can instantiate.
So if you did a "Add New Item", "Crystal Report", and named it
"EmployeeByDepartmentReport" (.rpt), then you'll have this code.
EmployeeByDepartmentReport empDeptRpt = new EmployeeByDepartmentReport ();
// as in myDataReport myDataReport = new myDataReport();
Here is another walk thru, from Crystal Reports itself:
http://resources.businessobjects.com...etdatasets.pdf
The most important lines of that KB are:
EmployeeByDepartmentReport empDeptRpt = new EmployeeByDepartmentReport();
EmployeeDS ds = SomeMethodYouCreateToMakeAnEmployeeDS();
/* Use Report Engine object model to pass populated dataset
to report */
empDeptRpt.SetDataSource (ds);
//CrystalReportViewer1 is the CR Viewer you "drag" onto the webform
/* bind report object with data to the Web Forms Viewer */
CrystalReportViewer1.ReportSource = empDeptRpt;
YOU STILL NEED TO LOOK AT THE KB and go through it, do not rely upon my code
(immediatly above).
I am just pointing out the important aspects/lines of the code.
"Paulo Roberto" <> wrote in message
news:...
> Thanks sloan, but on the article I see that was created a .xsd schema...
> must it be created just to design the CR (fields, sqls, grouping, etc...)?
>
> and what is: myDataReport myDataReport = new myDataReport();
>
> myDataReport is a class? how can it be accessed?
>
> thanks again man!
>
>
> "shh" <> escreveu na mensagem
> news: ups.com...
>>
>> http://www.codeproject.com/useritems...talReports.asp
>>
>> Follow the instructions at the link. Which involved creating a
>> dataset, before working with CR.
>>
>> What you describe below is the "pull", because you're adding
>> connection strings, select queries, etc, etc.
>>
>> This is the exact thing I said is a dangerous slope.
>>
>> Go through the instructions (at the link), and don't just download
>> the code and run it.
>> Go through the directions yourself.
>>
>>
>>
>>
>>
>>
>>
>>
>>
>> On Oct 8, 6:46 pm, "Paulo Roberto" <paulo.robe...@edt.com.br> wrote:
>>> sloan, thanks the help...
>>>
>>> I designed a CR report from wizard and I had to set a database
>>> connection to
>>> make the report: groups, displayed fields, tests, etc. when I click
>>> Preview
>>> Report it shows fine... beautiful... but how will I deploy on the server
>>> ? I
>>> have to pass the sql server connstr from web.config...
>>>
>>> Im using the code: report.SetDataSource(ds); but the aspx shows me a
>>> default
>>> box form to fill the properties like database, userid, pwd, etc... maybe
>>> Im
>>> not setting some property, something like that... what do you think ?
>>>
>>> About deploying I need to copy the CR dlls to the bin folder?
>>>
>>> thanks man!
>>>
>>> "sloan" <sl...@ipass.net> escreveu na
>>> mensagemnews: ...
>>>
>>>
>>>
>>> > You're missing the point.
>>>
>>> > // set report's dataset
>>> > report.SetDataSource(ds);
>>>
>>> > You give it an already populated dataset.
>>>
>>> > the CR should NOT know anything about a db connection string.
>>>
>>> > You need to write some kind of code to populate the dataset.
>>>
>>> > "sloan" <sl...@ipass.net> wrote in message
>>> >news:...
>>>
>>> >> Dim connectionStrings As ConnectionStringSettingsCollection =
>>> >> ConfigurationManager.ConnectionStrings
>>>
>>> >> Dim connection As ConnectionStringSettings
>>> >> For Each connection In connectionStrings
>>>
>>> >> Dim connectionStringName As String = connection.Name
>>> >> Dim connectionString As String =
>>> >> connection.ConnectionString
>>> >> Dim providerName As String = connection.ProviderName
>>>
>>> >> Debug.Print(connectionStringName)
>>> >> Next connection
>>>
>>> >> "Paulo" <prbs...@uol.com.br> wrote in message
>>> >>news:...
>>> >>> Hi, how can I pass the ConnectionString from web.config to a CR
>>> >>> report?
>>>
>>> >>> Thanks!
>>
>>
>
>