473,594 Members | 2,812 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Dynamic SQL based Crystal Reports

Hey all,

Been working with the Crystal Report Viewer, and have run into a situation I
am hoping someone can help me get past. This may be more of a CR question,
but hoping for some CR gurus to stop by in here.

Crystal's knowledgebase has made available a bunch of examples for both
ASP.Net and VB.Net applications for download and review (I added the links
at the end of this post). One of the examples is how to pass in a parameter
to the form from the .aspx page so you can alter what is displayed. However,
on closer inspection, you find that the form pulls across a huge set of
records and merely filters out all records not in the group matching the
parameter passed in.

My snag is that I do not want to pull across a huge set of records, rather I
would prefer to use a stored procedure on the SQL Server that accepts a
parameter and returns only those records I want. The records are the same
structure every time, just the content may be different. While the example
shows how to pass in the parameter, I do not know how to set up the form to
utilize not just a Stored Procedure, but rather one that requires a
parameter.

In short: Create an ASP.Net page that displays a Crystal Report whose data
is determined by a parameter passed in to the report and used in a Stored
Procedure tying it to a SQL Server.

Has anyone in here run into this situation and can explain how to deal with
it?

-- Andrew

Crystal Decisions Project Examples:
--------------------------------------------
VB .NET Web Sample Applications
http://support.businessobjects.com/c...amples.exe.asp

VB .NET Windows Sample Applications
http://support.businessobjects.com/c...amples.exe.asp

Nov 18 '05 #1
4 4637
"Andrew" <An********@hot mail.com> wrote in
news:OG******** ******@TK2MSFTN GP11.phx.gbl:
My snag is that I do not want to pull across a huge set of records,
rather I would prefer to use a stored procedure on the SQL Server that
accepts a parameter and returns only those records I want. The
records are the same structure every time, just the content may be
different. While the example shows how to pass in the parameter, I do
not know how to set up the form to utilize not just a Stored
Procedure, but rather one that requires a parameter.


Here is what I do:
1. Create an stored procedure

2. Create an ADO.NET Recordset (Add New Item -> Dataset) in Visual
Studios

3. Create a new Report - referecing the ADO.NET report

4. Fill the Dataset with the Report Data. Be sure to name the tables in
the Dataset - CR needs the proper dataset table names to load the data
properly.

5. Bind the dataset to the report.
BTW, you may want to use the System.reflecti on classes to create a
dynamic loader - that is what I do an works very well.

--
Lucas Tam (RE********@rog ers.com)
Please delete "REMOVE" from the e-mail address when replying.
http://members.ebay.com/aboutme/coolspot18/
Nov 18 '05 #2
Lucas Tam,

Thanks for the response and suggestions. I will go see if I can get
this to work...it sounds just like what I need to do. I smacked my forehead
for not thinking of it myself. :)
In the mean time -- and if you see this message -- if I could ask a
couple quick questions....

1) Do I have to use the GUI version (or "drag&drop" version) of the
ADO.Net Dataset, or can I use one coded by hand to bind to? I ask this
because I crerated a .Net DLL that handles all of my Dataset, DataReader, DB
Connectivity, etc., stuff (cuts down on the rewriting of code time) and
would like to use that if possible.

2) I am not quite sure I follow your suggestion of using the
System.Reflecti on classes. Are you saying to create a sub/function that
sets up the Dataset per passed in info prior to binding the CRViewer upon
page load? Or are you talking about something else? I figured to simply do
the former: read in some data passed through ah HTML Form or URL Item, set
up the Dataset's SQL statement from these, get the records, bind the report,
and view the page. If you are suggesting an alternate method, I am always
open to new ideas.

The usage of the CRViewer is still very new to me, as well as still
being fresh to .Net. I appreciate your help. Thanks again.

-- Andrew
"Lucas Tam" <RE********@rog ers.com> wrote in message
news:Xn******** *************** ****@140.99.99. 130...
"Andrew" <An********@hot mail.com> wrote in
news:OG******** ******@TK2MSFTN GP11.phx.gbl:
My snag is that I do not want to pull across a huge set of records,
rather I would prefer to use a stored procedure on the SQL Server that
accepts a parameter and returns only those records I want. The
records are the same structure every time, just the content may be
different. While the example shows how to pass in the parameter, I do
not know how to set up the form to utilize not just a Stored
Procedure, but rather one that requires a parameter.


Here is what I do:
1. Create an stored procedure

2. Create an ADO.NET Recordset (Add New Item -> Dataset) in Visual
Studios

3. Create a new Report - referecing the ADO.NET report

4. Fill the Dataset with the Report Data. Be sure to name the tables in
the Dataset - CR needs the proper dataset table names to load the data
properly.

5. Bind the dataset to the report.
BTW, you may want to use the System.reflecti on classes to create a
dynamic loader - that is what I do an works very well.

--
Lucas Tam (RE********@rog ers.com)
Please delete "REMOVE" from the e-mail address when replying.
http://members.ebay.com/aboutme/coolspot18/

Nov 18 '05 #3
"Andrew" <An********@hot mail.com> wrote in
news:ej******** ******@TK2MSFTN GP10.phx.gbl:
1) Do I have to use the GUI version (or "drag&drop" version) of
the
ADO.Net Dataset, or can I use one coded by hand to bind to? I ask
this because I crerated a .Net DLL that handles all of my Dataset,
DataReader, DB Connectivity, etc., stuff (cuts down on the rewriting
of code time) and would like to use that if possible.
You use the GUI version to generate a Dataset. This dataset will be
referenced by Crystal Reports.

You will still need fill the dataset tho.

BTW, take a look at Microsoft's Data Building Blocks. Microsoft has
already written a set of classes to handle typical ADO.NET operations.
2) I am not quite sure I follow your suggestion of using the
System.Reflecti on classes. Are you saying to create a sub/function
that sets up the Dataset per passed in info prior to binding the
CRViewer upon page load? Or are you talking about something else? I
figured to simply do the former: read in some data passed through ah
HTML Form or URL Item, set up the Dataset's SQL statement from these,
get the records, bind the report, and view the page. If you are
suggesting an alternate method, I am always open to new ideas.


I'm using the System.Reflecti on classes to dynamically instantiate the
reports. I'm using the embedded version the reports - rather than
loading the reports off the disk, I am dynamically invoking a new
instance of each rpeort by calling the report's respective classes.

If this doesn't make sense to you, there are two ways of loading a CR
report. Either off a disk or by calling a report's classname and
instantiating it that way.

Reading off a disk is good if you wish to edit your reports often.
Instantiating a report via it's class name is good if you wish to embed
the reports inside the DLL and not have the report files exposed to the
outside world.

--
Lucas Tam (RE********@rog ers.com)
Please delete "REMOVE" from the e-mail address when replying.
http://members.ebay.com/aboutme/coolspot18/
Nov 18 '05 #4
>
You use the GUI version to generate a Dataset. This dataset will be
referenced by Crystal Reports.

You will still need fill the dataset tho.
Got it. Built a quickie test page, and everything runnning smoothly.
Thanks for the help on this one. Can't believe how quick and easy this
was....waiting for something to go wrong. :)

BTW, take a look at Microsoft's Data Building Blocks. Microsoft has
already written a set of classes to handle typical ADO.NET operations.

I will look into this, thanks for the heads up. :)

Instantiating a report via it's class name is good if you wish to embed
the reports inside the DLL and not have the report files exposed to the
outside world.


Ahhh, was doing this already, just didn't follow the way you were referring
to it. :)

Again, thanks for your help, and I hope I can ask you questions in the
future if I run into more snags.

-- Andrew
Nov 18 '05 #5

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
13439
by: Sam | last post by:
Hello everyone, I have a table, which contains a picture column, I put URL info into it. "www.myweb.com/1.jpg..." I want to show this picture in my crystal report, I find some samples show the "static" picture in Crystal report, No "Dynamic" one. Can Crystal Report do that? Thanks in advance. Sam
1
17654
by: Nathan Bloomfield | last post by:
Does anyone know if there is any documentation which relates to Access2k + ? or can anyone help adjust the code? I am having trouble converting the DAO references. TITLE :INF: How to Create a Dynamic Crosstab Report PRODUCT :Microsoft Access PROD/VER:1.00 1.10 OPER/SYS:WINDOWS
1
6323
by: Rutko | last post by:
Is it possible to dynamically create report and save it in rpt file? For example I want to add an text object in report on x,y position in page header. I need that dynamically, because I have a lot of reports made in Visual FoxPro. It would be nice if I could make a converter. I read VFP Report a.frx, see a text on position x,y in header and I create text object in crystal reports on the same position etc... and save the report to a.rpt....
7
4994
by: p | last post by:
WE had a Crystal 8 WebApp using vs 2002 which we upgraded to VS2003. I also have Crystal 9 pro on my development machine. The web app runs fine on my dev machine but am having problems deploying. I created the websetup and built the MSI, have the bundled version. Copied to webserver and ran Websetup.msi. Said I had to remove old version, which I did, then reran WebSetup.msi and keeps giving me this error. "The installer was interrupted...
5
3066
by: Ron | last post by:
I have a bunch of Crystal Reports (v9) published as WebServices and use a ReportViewer to display the reports on the ASPNET page. Everytime we move the reports from dev to production we have to open the reports and manually change the datasouce to the production database. Is there a way to set the datasouce on the webserviced reports dynamically? (A datasource property or something?) cant seem to find anything. Thanks!
4
1687
by: Diego F. | last post by:
Is it possible to generate dynamic reports with Crystal? I'm having problems printing a datagrid because the last line of each page gets cut, so I was thinking of using Crystal. I want to simply pass the datasource of the datagrid and then get the report. Is that possible? -- Regards, Diego F.
0
2169
by: PughDR | last post by:
As the subject of this topic suggestions I am trying to find a way to use ASP, SQL Server, Com+ and Crystal Reports 8.5 to Create Dynamic PDF Reports Over The Web, but the only article I found that decribes this process is located on ASPToday.com which is no longer an active website. When I try and suscribe to the site I just get a message saying to email, and when I email I don't recieve a response. Anyway the article I am looking for...
7
6699
by: Jlo | last post by:
Hi, I have a c# winforms application. When I call the report file, it shows me all the records in the table. How can I make it to call only a particular range. i have the following code Viewer1.ReportSource = Application.StartupPath + "//Label.rpt"; How can I assign it a dataset which have the data of a particular range.
1
2326
by: bhappy | last post by:
Hai All, I want to create crystal reports dynamically, I don't know the columns i will take it from database at runtime, im getting all data into one dataset and im convrting dataset into xml schama, then im using that xml schama in crystal reports,there i drag n drop all fields in xml schama to crystal report, up to here its working fine, but when ever i changed fields in database i have to change in crystal report also Is there any...
0
7946
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
7877
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
1
8009
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
8240
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
1
5739
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5411
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
1
2389
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
1
1482
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
1216
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.