C1 Community
ComponentOne Community is a free source for developers and help authors to collaborate and communicate.

Newbie questions: connection strings, parameters, headers

rated by 0 users
This post has 2 Replies | 1 Follower

Not Ranked
Posts 3
ekolis Posted: Mon, Mar 23 2009 10:46 AM

First off, I'm quite impressed with ComponentOne's ASP.NET tools; I'm using a trial version right now for evaluation purposes but my boss wants to buy a license soon so we can use this in production.

I do have a few questions which I hope someone can answer or at least point me in the right direction:

1. How do I override the connection string of a web report in VB.NET code? We have multiple databases with the same tables and stored procedures, just different data, one for each customer. It would be annoying to have to duplicate the report definitions as well, since they contain the connection strings within them.

2. How do I pass a parameter to a report via VB.NET code, without using dynamic SQL? I see that if I create a report based off of a parameterized stored procedure (impressive that that's possible!), I get a popup whenever I try to view the report asking me to enter an employeeID or whatnot into a script editor; that's not all that user-friendly, so I'd like to use ASP.NET dropdowns and such to get the parameters. But it seems that the only documentation I can find about passing the parameters into the report tells me that I have to generate a SQL string dynamically, which seems rather odd - maybe I'm expecting too much, but I was hoping for some sort of object model for report parameters so I don't have to worry about SQL injection!

3. How do I set a "standard" header and footer for all reports I create, or alternatively, dynamically insert one into the report as it is viewed? This would make creating consistently branded and themed reports a bit simpler, as if you want to make a change, you wouldn't have to go back and edit every single report manually!

 Thanks for any help that anyone can provide!

Top 25 Contributor
Posts 666
C1_DaveT replied on Fri, Mar 27 2009 5:55 PM

1) You may use  C1WebReport1.Report.DataSource.ConnectionString property of the report to set them to a different connection string.

 

2) Currently there is no such direct feature for parameter passing.

 

3) You may access header section in code and set its field values, so it is easy to give same appearance or value to header and footer of all different reports by setting them in code.

 

-Dave.

<ekolis> wrote in message news:215710@10.0.1.98...

First off, I'm quite impressed with ComponentOne's ASP.NET tools; I'm using a trial version right now for evaluation purposes but my boss wants to buy a license soon so we can use this in production.

I do have a few questions which I hope someone can answer or at least point me in the right direction:

1. How do I override the connection string of a web report in VB.NET code? We have multiple databases with the same tables and stored procedures, just different data, one for each customer. It would be annoying to have to duplicate the report definitions as well, since they contain the connection strings within them.

2. How do I pass a parameter to a report via VB.NET code, without using dynamic SQL? I see that if I create a report based off of a parameterized stored procedure (impressive that that's possible!), I get a popup whenever I try to view the report asking me to enter an employeeID or whatnot into a script editor; that's not all that user-friendly, so I'd like to use ASP.NET dropdowns and such to get the parameters. But it seems that the only documentation I can find about passing the parameters into the report tells me that I have to generate a SQL string dynamically, which seems rather odd - maybe I'm expecting too much, but I was hoping for some sort of object model for report parameters so I don't have to worry about SQL injection!

3. How do I set a "standard" header and footer for all reports I create, or alternatively, dynamically insert one into the report as it is viewed? This would make creating consistently branded and themed reports a bit simpler, as if you want to make a change, you wouldn't have to go back and edit every single report manually!

 Thanks for any help that anyone can provide!



http://helpcentral.componentone.com/cs/forums/p/78623/215710.aspx#215710

Not Ranked
Posts 3
ekolis replied on Mon, Mar 30 2009 9:01 AM

Hmm, I'm glad you were able to answer two of my questions, but to be honest it's quite surprising that there's no way to pass parameters into the report, short of inserting custom SQL code at runtime... thank you for your time, though, and if I have any further questions I'll make sure to ask!

Page 1 of 1 (3 items) | RSS
Contact ComponentOne: 1.800.858.2739 ©1987-2010 ComponentOne LLC All Rights Reserved.