Good afternoon all,
I guess I am missing the benefit of using datasets with Crystal. For
years I have written wrapper apps that used the Pull method and I let
Crystal do all the sql work. Now I have an issue where the queries run
for 4+ minutes so I don't want Crystal doing repeated legwork.
I was under the impression that once the DataSet is filled and bound to
the report the report (crystalviewer) would not need to re-run the
query - thus speeding up paging and such.
The way I have my code set up now, following the scores of examples,
everytime I hit the Next|Previous button in the CrystalViewer the code
is regenerated and the dataset is filled, and the crystalviewer is
assigned and the report takes the same amount of time to move to the
next page as it did on its initial load. I have confirmed that the
acquiring of information and modifying of sql querries on the fly is
working so I am happy with the dataset process itself but I am
dissappointed in the way it is supposedly implemented.
All of the sample code I have seen states to put the dataset and report
object code at the following:
"After the call to InitializeCompo nent() in PageInit()"
When I put my code inside PageInit() it is called repeatedly whenever
the Next|Previous button is selected. I've tried installing the code
inside the Page_Load() method but it too is called every time the
Next|Previous button is called.
Am I wrong in my believing that this process of creating a dataset,
filling it, assigning it using SetDataSource() method is unneccessary
and detrimental to performance?
Could someone please steer me in the right direction on this - I
believe it is a matter of placing my code in the proper place or
processing the Next|Previous response differently to avoid rebuilding
the report and re-running the dataset build.
Dave
CODE:
override protected void OnInit(EventArg s e)
{
InitializeCompo nent();
base.OnInit(e);
// If we have an error in that the report template name is
// set to "error.rpt" then DON'T try to set parameter or connection
info.
if( this.reportDocu ment1.FileName. IndexOf("error. rpt") == -1 )
{
if( this.reportDocu ment1.Subreport s.Count > 0 )
setsubreportpar aminfo();
setvieweroption s();
}
// set up connection information
string myConnString = "Server="
+ cfgFile.getserv er().Trim()
+ ";Trusted_Conne ction=no" // + cfgFile.getconn type().Trim()
+ ";Database= " + cfgFile.getdata base().Trim()
+ ";UID=" + HttpContext.Cur rent.Session["UserID"]
+ ";PWD=" + HttpContext.Cur rent.Session["Password"];
SqlConnection sqlConn = new SqlConnection(m yConnString);
SqlDataAdapter dataAdapter = new SqlDataAdapter( );
dataAdapter.Sel ectCommand = new SqlCommand(this .buildQuery(),
sqlConn);
DataSet dataSet = new DataSet();
// Connect to, fetch data, and disconnect from database
int rowcount = dataAdapter.Fil l (dataSet);
// Use Report Engine object model to pass
// populated dataset to report
this.reportDocu ment1.SetDataSo urce (dataSet);
setparaminfo( this.reportDocu ment1 );
this.CrystalRep ortViewer1.Repo rtSource = this.reportDocu ment1;
} 3 1797
Try caching your dataset .. then hand back the dataset when it asks for it
again.
your code would then become.
if(!Cache.Conta ins("my data")) {
Cache["mydata"] = GetMyDataSet();
}
return Cache["mydata"];
This should speed you up immensely.
Cheers,
Greg Young
MVP - C# http://geekswithblogs.net/gyoung
"dekern" <d_******@hotma il.com> wrote in message
news:11******** **************@ g10g2000cwb.goo glegroups.com.. . Good afternoon all,
I guess I am missing the benefit of using datasets with Crystal. For years I have written wrapper apps that used the Pull method and I let Crystal do all the sql work. Now I have an issue where the queries run for 4+ minutes so I don't want Crystal doing repeated legwork.
I was under the impression that once the DataSet is filled and bound to the report the report (crystalviewer) would not need to re-run the query - thus speeding up paging and such.
The way I have my code set up now, following the scores of examples, everytime I hit the Next|Previous button in the CrystalViewer the code is regenerated and the dataset is filled, and the crystalviewer is assigned and the report takes the same amount of time to move to the next page as it did on its initial load. I have confirmed that the acquiring of information and modifying of sql querries on the fly is working so I am happy with the dataset process itself but I am dissappointed in the way it is supposedly implemented.
All of the sample code I have seen states to put the dataset and report object code at the following:
"After the call to InitializeCompo nent() in PageInit()"
When I put my code inside PageInit() it is called repeatedly whenever the Next|Previous button is selected. I've tried installing the code inside the Page_Load() method but it too is called every time the Next|Previous button is called.
Am I wrong in my believing that this process of creating a dataset, filling it, assigning it using SetDataSource() method is unneccessary and detrimental to performance?
Could someone please steer me in the right direction on this - I believe it is a matter of placing my code in the proper place or processing the Next|Previous response differently to avoid rebuilding the report and re-running the dataset build.
Dave
CODE:
override protected void OnInit(EventArg s e) { InitializeCompo nent(); base.OnInit(e);
// If we have an error in that the report template name is // set to "error.rpt" then DON'T try to set parameter or connection info. if( this.reportDocu ment1.FileName. IndexOf("error. rpt") == -1 ) { if( this.reportDocu ment1.Subreport s.Count > 0 ) setsubreportpar aminfo(); setvieweroption s(); }
// set up connection information string myConnString = "Server=" + cfgFile.getserv er().Trim() + ";Trusted_Conne ction=no" // + cfgFile.getconn type().Trim() + ";Database= " + cfgFile.getdata base().Trim() + ";UID=" + HttpContext.Cur rent.Session["UserID"] + ";PWD=" + HttpContext.Cur rent.Session["Password"];
SqlConnection sqlConn = new SqlConnection(m yConnString);
SqlDataAdapter dataAdapter = new SqlDataAdapter( );
dataAdapter.Sel ectCommand = new SqlCommand(this .buildQuery(), sqlConn);
DataSet dataSet = new DataSet();
// Connect to, fetch data, and disconnect from database int rowcount = dataAdapter.Fil l (dataSet);
// Use Report Engine object model to pass // populated dataset to report this.reportDocu ment1.SetDataSo urce (dataSet);
setparaminfo( this.reportDocu ment1 ); this.CrystalRep ortViewer1.Repo rtSource = this.reportDocu ment1; }
Thanks for the response Greg.
So just where would I place this code?, as the first line in the
OnInit() method?
Dave
Greg Young wrote: Try caching your dataset .. then hand back the dataset when it asks for it again.
your code would then become.
if(!Cache.Conta ins("my data")) { Cache["mydata"] = GetMyDataSet(); } return Cache["mydata"];
This should speed you up immensely.
Cheers,
Greg Young MVP - C# http://geekswithblogs.net/gyoung "dekern" <d_******@hotma il.com> wrote in message news:11******** **************@ g10g2000cwb.goo glegroups.com.. . Good afternoon all,
I guess I am missing the benefit of using datasets with Crystal. For years I have written wrapper apps that used the Pull method and I let Crystal do all the sql work. Now I have an issue where the queries run for 4+ minutes so I don't want Crystal doing repeated legwork.
I was under the impression that once the DataSet is filled and bound to the report the report (crystalviewer) would not need to re-run the query - thus speeding up paging and such.
The way I have my code set up now, following the scores of examples, everytime I hit the Next|Previous button in the CrystalViewer the code is regenerated and the dataset is filled, and the crystalviewer is assigned and the report takes the same amount of time to move to the next page as it did on its initial load. I have confirmed that the acquiring of information and modifying of sql querries on the fly is working so I am happy with the dataset process itself but I am dissappointed in the way it is supposedly implemented.
All of the sample code I have seen states to put the dataset and report object code at the following:
"After the call to InitializeCompo nent() in PageInit()"
When I put my code inside PageInit() it is called repeatedly whenever the Next|Previous button is selected. I've tried installing the code inside the Page_Load() method but it too is called every time the Next|Previous button is called.
Am I wrong in my believing that this process of creating a dataset, filling it, assigning it using SetDataSource() method is unneccessary and detrimental to performance?
Could someone please steer me in the right direction on this - I believe it is a matter of placing my code in the proper place or processing the Next|Previous response differently to avoid rebuilding the report and re-running the dataset build.
Dave
CODE:
override protected void OnInit(EventArg s e) { InitializeCompo nent(); base.OnInit(e);
// If we have an error in that the report template name is // set to "error.rpt" then DON'T try to set parameter or connection info. if( this.reportDocu ment1.FileName. IndexOf("error. rpt") == -1 ) { if( this.reportDocu ment1.Subreport s.Count > 0 ) setsubreportpar aminfo(); setvieweroption s(); }
// set up connection information string myConnString = "Server=" + cfgFile.getserv er().Trim() + ";Trusted_Conne ction=no" // + cfgFile.getconn type().Trim() + ";Database= " + cfgFile.getdata base().Trim() + ";UID=" + HttpContext.Cur rent.Session["UserID"] + ";PWD=" + HttpContext.Cur rent.Session["Password"];
SqlConnection sqlConn = new SqlConnection(m yConnString);
SqlDataAdapter dataAdapter = new SqlDataAdapter( );
dataAdapter.Sel ectCommand = new SqlCommand(this .buildQuery(), sqlConn);
DataSet dataSet = new DataSet();
// Connect to, fetch data, and disconnect from database int rowcount = dataAdapter.Fil l (dataSet);
// Use Report Engine object model to pass // populated dataset to report this.reportDocu ment1.SetDataSo urce (dataSet);
setparaminfo( this.reportDocu ment1 ); this.CrystalRep ortViewer1.Repo rtSource = this.reportDocu ment1; }
Yes in your oninit method ..
"dekern" <d_******@hotma il.com> wrote in message
news:11******** **************@ y43g2000cwc.goo glegroups.com.. . Thanks for the response Greg.
So just where would I place this code?, as the first line in the OnInit() method?
Dave
Greg Young wrote: Try caching your dataset .. then hand back the dataset when it asks for it again.
your code would then become.
if(!Cache.Conta ins("my data")) { Cache["mydata"] = GetMyDataSet(); } return Cache["mydata"];
This should speed you up immensely.
Cheers,
Greg Young MVP - C# http://geekswithblogs.net/gyoung "dekern" <d_******@hotma il.com> wrote in message news:11******** **************@ g10g2000cwb.goo glegroups.com.. . > Good afternoon all, > > I guess I am missing the benefit of using datasets with Crystal. For > years I have written wrapper apps that used the Pull method and I let > Crystal do all the sql work. Now I have an issue where the queries run > for 4+ minutes so I don't want Crystal doing repeated legwork. > > I was under the impression that once the DataSet is filled and bound to > the report the report (crystalviewer) would not need to re-run the > query - thus speeding up paging and such. > > The way I have my code set up now, following the scores of examples, > everytime I hit the Next|Previous button in the CrystalViewer the code > is regenerated and the dataset is filled, and the crystalviewer is > assigned and the report takes the same amount of time to move to the > next page as it did on its initial load. I have confirmed that the > acquiring of information and modifying of sql querries on the fly is > working so I am happy with the dataset process itself but I am > dissappointed in the way it is supposedly implemented. > > All of the sample code I have seen states to put the dataset and report > object code at the following: > > "After the call to InitializeCompo nent() in PageInit()" > > When I put my code inside PageInit() it is called repeatedly whenever > the Next|Previous button is selected. I've tried installing the code > inside the Page_Load() method but it too is called every time the > Next|Previous button is called. > > Am I wrong in my believing that this process of creating a dataset, > filling it, assigning it using SetDataSource() method is unneccessary > and detrimental to performance? > > Could someone please steer me in the right direction on this - I > believe it is a matter of placing my code in the proper place or > processing the Next|Previous response differently to avoid rebuilding > the report and re-running the dataset build. > > Dave > > > CODE: > > override protected void OnInit(EventArg s e) > { > InitializeCompo nent(); > base.OnInit(e); > > // If we have an error in that the report template name is > // set to "error.rpt" then DON'T try to set parameter or connection > info. > if( this.reportDocu ment1.FileName. IndexOf("error. rpt") == -1 ) > { > if( this.reportDocu ment1.Subreport s.Count > 0 ) > setsubreportpar aminfo(); > setvieweroption s(); > } > > // set up connection information > string myConnString = "Server=" > + cfgFile.getserv er().Trim() > + ";Trusted_Conne ction=no" // + cfgFile.getconn type().Trim() > + ";Database= " + cfgFile.getdata base().Trim() > + ";UID=" + HttpContext.Cur rent.Session["UserID"] > + ";PWD=" + HttpContext.Cur rent.Session["Password"]; > > SqlConnection sqlConn = new SqlConnection(m yConnString); > > SqlDataAdapter dataAdapter = new SqlDataAdapter( ); > > dataAdapter.Sel ectCommand = new SqlCommand(this .buildQuery(), > sqlConn); > > DataSet dataSet = new DataSet(); > > // Connect to, fetch data, and disconnect from database > int rowcount = dataAdapter.Fil l (dataSet); > > // Use Report Engine object model to pass > // populated dataset to report > this.reportDocu ment1.SetDataSo urce (dataSet); > > setparaminfo( this.reportDocu ment1 ); > this.CrystalRep ortViewer1.Repo rtSource = this.reportDocu ment1; > } > This thread has been closed and replies have been disabled. Please start a new discussion. Similar topics |
by: Dr. Indera |
last post by:
hello,
i previously posted the questions below on several crystal reports newsgroups, including the one for
the company that makes crystal reports, but never got an answer, so i'm hoping that someone on this
board knows the answers to them. the questions are for the version of crystal that ships with visual
studio.net 2003. if it helps, the reports that i create are in a visual basic.net project. it was
recommended that i post the...
|
by: cycloneboy |
last post by:
When I call a crystal report via a hyperlink the report runs great.
If I click the BACK button on the browser and then click the hyperlink to
call the report again I get
CrystalDecisions.CrystalReports.Engine.LoadSaveReportException: Load report
failed.
More troubleshooting info…
When I call a crystal report via a hyperlink the report runs great.
|
by: Darrin |
last post by:
Hello, I am looking for a web reporting solution. I have researched some
things on crystal reports but read that the version that is bundled with
Visual Studio 2003 does not allow you to print them. I was able to create a
sample looking report in ASP.NET using VS2003 but not able to print it. Is
there some specific code a person could use as I did not see a print button.
I was thinking of creating my own reports but having a hard time...
|
by: N. Demos |
last post by:
Hello,
I'm learning ASP.NET, and am having a strange problem with some example
code from the book I'm using. The code increments and displays the value
stored in a session variable when the "Add" button is clicked. In
addition, the session variable is reset to zero when the "Empty" button
is pressed.
The problem is if the value is non-zero and the page is reloaded the
value is incremented. It appears as if the "Add" onClick event...
|
by: Stefan Mueller |
last post by:
After my web page has been loaded I'm doing some tests with a JavaScript. If
I figure out that something is wrong I'd like to reload the whole frameset.
With Internet Explorer and Mozilla Firefox I can reload the whole frameset
with
parent.location.href = "index.html";
However, this doesn't work with Opera.
Does someone know how to do that with Opera?
| |
by: steveberwick |
last post by:
**Using Visual Studio 2005 and Crystal Reports XI Release 2 Developer
Edition.
I currently have a multi-threaded C# application that loads a Crystal
Report at runtime, fills out the necessary parameters and then exports
the file to disk.
I export around 5000 reports a day, in about 3 hours (nightly runs of
the day's transactions), but sometimes, without warning or any debug
info, the application locks-up using 100% of the processor...
|
by: GaryDean |
last post by:
I have a Wizard page and need to affect the next and previous buttons from
my code-behind. I've googled around and found two solutions, and neither
appear to work.
I can access the SideBarList steps successfully with the following code...
Control myContainer =
(Control)Wizard1.FindControl("SideBarContainer");
DataList mySideBarList =
(DataList)myContainer.FindControl("SideBarList");
|
by: Miro |
last post by:
I can run an exe ( and its install ) i have created on my machine.
The exe has a button that populates a dataset and then shoots it to a
crystal report.
But...
Installing the setup.exe on my other pc, and running it I get an error.
The Dataset loads properly, but when the button is pushed to view the report
I get this error:
************** Exception Text **************
|
by: Miro |
last post by:
<i have also added this reply to the other newsgroup - now that I have
realizd ( and assuming ) it is not a localized error directly to vb.>
I have found this link on the website:
https://www.sdn.sap.com/irj/sdn/businessobjects-downloads
..NET Utility CR 2008 Merge Modules for the .NET Framework ZIP 74.716 Windows
English 12.03.2008
and it states:
|
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,...
|
by: Oralloy |
last post by:
Hello folks,
I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>".
The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed.
This is as boiled down as I can make it.
Here is my compilation command:
g++-12 -std=c++20 -Wnarrowing bit_field.cpp
Here is the code in...
| |
by: jinu1996 |
last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth.
The Art of Business Website Design
Your website is...
|
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...
|
by: agi2029 |
last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own....
Now, this would greatly impact the work of software developers. The idea...
|
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...
|
by: TSSRALBI |
last post by:
Hello
I'm a network technician in training and I need your help.
I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs.
The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols.
I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
|
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
| |
by: muto222 |
last post by:
How can i add a mobile payment intergratation into php mysql website.
| |