Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > CR report connStr

Reply
Thread Tools

CR report connStr

 
 
Paulo
Guest
Posts: n/a
 
      10-08-2007
Hi, how can I pass the ConnectionString from web.config to a CR report?

Thanks!


 
Reply With Quote
 
 
 
 
sloan
Guest
Posts: n/a
 
      10-08-2007

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" <> wrote in message
news:...
> Hi, how can I pass the ConnectionString from web.config to a CR report?
>
> Thanks!
>



 
Reply With Quote
 
 
 
 
sloan
Guest
Posts: n/a
 
      10-08-2007

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" <> 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" <> wrote in message
> news:...
>> Hi, how can I pass the ConnectionString from web.config to a CR report?
>>
>> Thanks!
>>

>
>



 
Reply With Quote
 
Paulo Roberto
Guest
Posts: n/a
 
      10-08-2007
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" <> escreveu na mensagem
news:...
>
> 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" <> 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" <> wrote in message
>> news:...
>>> Hi, how can I pass the ConnectionString from web.config to a CR report?
>>>
>>> Thanks!
>>>

>>
>>

>
>



 
Reply With Quote
 
shh
Guest
Posts: n/a
 
      10-09-2007

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!



 
Reply With Quote
 
Paulo Roberto
Guest
Posts: n/a
 
      10-09-2007
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!

>
>



 
Reply With Quote
 
sloan
Guest
Posts: n/a
 
      10-09-2007

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!

>>
>>

>
>



 
Reply With Quote
 
Paulo
Guest
Posts: n/a
 
      10-09-2007
thanks, but when I rename the rpt file does not show as you said:
EmployeeByDepartmentReport empDeptRpt = new EmployeeByDepartmentReport ();

the CR article tells us to type: "public CustomerSales oRpt = null" wich
CustomerSales is the name of file, but when hit Ctrl+F5 the VS stops: "The
type or namespace could not be found"...

What can be the problem?

thanks sloan!

"sloan" <> escreveu na mensagem
news:%...
>
> 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!
>>>
>>>

>>
>>

>
>



 
Reply With Quote
 
sloan
Guest
Posts: n/a
 
      10-09-2007
You don't rename the file

//but when I rename the rpt file //end quote

.........

When you add the file, it gets added as Something.rpt (I think that's the
extension)

but somewhere (under the covers), there is an object of that name.


I'd start with the KB on how to do it, and work up from there, instead of
taking your already existing report.

Learn the fundamentals with the KB example, when move up from there.




"Paulo" <> wrote in message
news:...
> thanks, but when I rename the rpt file does not show as you said:
> EmployeeByDepartmentReport empDeptRpt = new EmployeeByDepartmentReport ();
>
> the CR article tells us to type: "public CustomerSales oRpt = null" wich
> CustomerSales is the name of file, but when hit Ctrl+F5 the VS stops: "The
> type or namespace could not be found"...
>
> What can be the problem?
>
> thanks sloan!
>
> "sloan" <> escreveu na mensagem
> news:%...
>>
>> 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!
>>>>
>>>>
>>>
>>>

>>
>>

>
>



 
Reply With Quote
 
Paulo
Guest
Posts: n/a
 
      10-09-2007
sloan, I found the article below, the user is having the same problem as
mine

http://aspalliance.com/776_Creating_...in_ASPNET_20.1

but on the end to solve his problem he creates a xml file... do you think it
is the solution?

"but somewhere (under the covers), there is an object of that name."

Where? not in my VS 2005 web-form...

thanks man!

"sloan" <> escreveu na mensagem
news:...
> You don't rename the file
>
> //but when I rename the rpt file //end quote
>
> ........
>
> When you add the file, it gets added as Something.rpt (I think that's the
> extension)
>
> but somewhere (under the covers), there is an object of that name.
>
>
> I'd start with the KB on how to do it, and work up from there, instead of
> taking your already existing report.
>
> Learn the fundamentals with the KB example, when move up from there.
>
>
>
>
> "Paulo" <> wrote in message
> news:...
>> thanks, but when I rename the rpt file does not show as you said:
>> EmployeeByDepartmentReport empDeptRpt = new EmployeeByDepartmentReport
>> ();
>>
>> the CR article tells us to type: "public CustomerSales oRpt = null" wich
>> CustomerSales is the name of file, but when hit Ctrl+F5 the VS stops:
>> "The type or namespace could not be found"...
>>
>> What can be the problem?
>>
>> thanks sloan!
>>
>> "sloan" <> escreveu na mensagem
>> news:%...
>>>
>>> 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!
>>>>>
>>>>>
>>>>
>>>>
>>>
>>>

>>
>>

>
>



 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
1.1 to 2.0 migration now requires TCP/IP port in ConnStr =?Utf-8?B?Z2VvZ3J1dmVu?= ASP .Net 0 10-24-2007 09:44 PM
The definition of the report 'Main Report' is invalid =?Utf-8?B?Sm9obiBCYWlsZXk=?= ASP .Net 0 07-02-2005 06:43 AM
Crysatl report load report failed Meheraj shaik via .NET 247 ASP .Net 1 06-07-2005 08:29 AM
Load Report Fails on ASP.NET app when report is on a different ser =?Utf-8?B?aHVicmlzdGljYm9i?= ASP .Net 1 03-17-2005 01:24 PM
Setting a Range Parameter in a crystal report and streaming resulting report as a pdf James Wallace ASP .Net 0 10-17-2003 04:42 PM



Advertisments
 



1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57