PC Review


Reply
Thread Tools Rate Thread

CR report connStr

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

Thanks!


 
Reply With Quote
 
 
 
 
sloan
Guest
Posts: n/a
 
      8th Oct 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" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed)...
> Hi, how can I pass the ConnectionString from web.config to a CR report?
>
> Thanks!
>



 
Reply With Quote
 
sloan
Guest
Posts: n/a
 
      8th Oct 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" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed)...
>
> 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" <(E-Mail Removed)> wrote in message
> news:(E-Mail Removed)...
>> Hi, how can I pass the ConnectionString from web.config to a CR report?
>>
>> Thanks!
>>

>
>



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

>>
>>

>
>



 
Reply With Quote
 
shh
Guest
Posts: n/a
 
      9th Oct 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:(E-Mail Removed)...
>
>
>
> > 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:(E-Mail Removed)...

>
> >> 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:(E-Mail Removed)...
> >>> Hi, how can I pass the ConnectionString from web.config to a CR report?

>
> >>> Thanks!



 
Reply With Quote
 
Paulo Roberto
Guest
Posts: n/a
 
      9th Oct 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" <(E-Mail Removed)> escreveu na mensagem
news:(E-Mail Removed)...
>
> 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:(E-Mail Removed)...
>>
>>
>>
>> > 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:(E-Mail Removed)...

>>
>> >> 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:(E-Mail Removed)...
>> >>> Hi, how can I pass the ConnectionString from web.config to a CR
>> >>> report?

>>
>> >>> Thanks!

>
>



 
Reply With Quote
 
sloan
Guest
Posts: n/a
 
      9th Oct 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" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed)...
> 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" <(E-Mail Removed)> escreveu na mensagem
> news:(E-Mail Removed)...
>>
>> 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:(E-Mail Removed)...
>>>
>>>
>>>
>>> > 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:(E-Mail Removed)...
>>>
>>> >> 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:(E-Mail Removed)...
>>> >>> Hi, how can I pass the ConnectionString from web.config to a CR
>>> >>> report?
>>>
>>> >>> Thanks!

>>
>>

>
>



 
Reply With Quote
 
Paulo
Guest
Posts: n/a
 
      9th Oct 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" <(E-Mail Removed)> escreveu na mensagem
news:%(E-Mail Removed)...
>
> 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" <(E-Mail Removed)> wrote in message
> news:(E-Mail Removed)...
>> 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" <(E-Mail Removed)> escreveu na mensagem
>> news:(E-Mail Removed)...
>>>
>>> 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:(E-Mail Removed)...
>>>>
>>>>
>>>>
>>>> > 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:(E-Mail Removed)...
>>>>
>>>> >> 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:(E-Mail Removed)...
>>>> >>> Hi, how can I pass the ConnectionString from web.config to a CR
>>>> >>> report?
>>>>
>>>> >>> Thanks!
>>>
>>>

>>
>>

>
>



 
Reply With Quote
 
sloan
Guest
Posts: n/a
 
      9th Oct 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" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed)...
> 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" <(E-Mail Removed)> escreveu na mensagem
> news:%(E-Mail Removed)...
>>
>> 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" <(E-Mail Removed)> wrote in message
>> news:(E-Mail Removed)...
>>> 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" <(E-Mail Removed)> escreveu na mensagem
>>> news:(E-Mail Removed)...
>>>>
>>>> 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:(E-Mail Removed)...
>>>>>
>>>>>
>>>>>
>>>>> > 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:(E-Mail Removed)...
>>>>>
>>>>> >> 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:(E-Mail Removed)...
>>>>> >>> Hi, how can I pass the ConnectionString from web.config to a CR
>>>>> >>> report?
>>>>>
>>>>> >>> Thanks!
>>>>
>>>>
>>>
>>>

>>
>>

>
>



 
Reply With Quote
 
Paulo
Guest
Posts: n/a
 
      9th Oct 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" <(E-Mail Removed)> escreveu na mensagem
news:(E-Mail Removed)...
> 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" <(E-Mail Removed)> wrote in message
> news:(E-Mail Removed)...
>> 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" <(E-Mail Removed)> escreveu na mensagem
>> news:%(E-Mail Removed)...
>>>
>>> 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" <(E-Mail Removed)> wrote in message
>>> news:(E-Mail Removed)...
>>>> 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" <(E-Mail Removed)> escreveu na mensagem
>>>> news:(E-Mail Removed)...
>>>>>
>>>>> 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:(E-Mail Removed)...
>>>>>>
>>>>>>
>>>>>>
>>>>>> > 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:(E-Mail Removed)...
>>>>>>
>>>>>> >> 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:(E-Mail Removed)...
>>>>>> >>> Hi, how can I pass the ConnectionString from web.config to a CR
>>>>>> >>> report?
>>>>>>
>>>>>> >>> Thanks!
>>>>>
>>>>>
>>>>
>>>>
>>>
>>>

>>
>>

>
>



 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

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
How to create duplicate report? (Copy of report, not report of dup iynque Microsoft Access Reports 1 5th Jun 2009 08:54 PM
1.1 to 2.0 migration now requires TCP/IP port in ConnStr =?Utf-8?B?Z2VvZ3J1dmVu?= Microsoft ASP .NET 0 24th Oct 2007 10:44 PM
Printing report b after report a prints using report a's variables =?Utf-8?B?QmxhemU=?= Microsoft Access Reports 0 8th Feb 2006 09:46 PM
Report / Sub report data source lost when adding a new sub report =?Utf-8?B?Sm9lIE1jQw==?= Microsoft Access Reports 5 4th Apr 2005 07:27 PM
Report button linked to exact report record- Open report method? =?Utf-8?B?UmljaA==?= Microsoft Access Forms 1 27th May 2004 06:17 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 06:31 AM.