|
Hi i am new to Crystal report. I search google example and create a Report. But at execution it ask Login information each time. I had a VB code for solution.
Dim ConnInfo As New ConnectionInfo
With ConnInfo
.ServerName = ".sqlexpress"
.DatabaseName = "Northwind"
.UserID = "sa"
.Password = "eXpress2005"
End With
For Each cnInfo As TableLogOnInfo In Me.CrystalReportViewer1.LogOnInfo
cnInfo.ConnectionInfo = ConnInfo
Next
End Sub
Can anyone tell the C# code to achieve this?
|
|
|
|
|
HI Karthik,
You can use this code for refrence to display crystal report.
sql= "";
DataSet ds = new DataSet();
OleDbDataAdapter AdpNew = new OleDbDataAdapter(sql,Conn);
AdpNew.Fill(ds);
Rpt ReportObject = new Rpt();
ReportObject.SetDataSource(ObjectName.Tables[0]);
ReportViewerName.Height = this.Height;
ReportViewerName.Width = this.Width;
ReportViewerName.ReportSource = ReportObject;
|
|
|
|
|
Need to change the date format in javascript.
format is dd/MM/yyyy
|
|
|
|
|
|
javascript does not have build-in date formatting. But, many people have wrote small js code to format date to various degree. Simple Google[^] search turns a wealth of examples.
|
|
|
|
|
Hi,
I am beginner in asp.net and my problem When i try to redirect with the code
Response.Redirect("~/Zone/Home.aspx?ZID=24&"); an exception is being raised i.e;
"Thread is being aborted" and after this redirection is done without any problems. What cud be the possible mistake made by me?
Plz help.
|
|
|
|
|
If you look at the Redirect[^] documentation, you will see it takes a second parameter of a type of bool to indicate if you want to terminate current page execution
use instead
Response.Redirect("~/Zone/Home.aspx?ZID=24&", false);
|
|
|
|
|
|
But, be aware that if you do set the value to false, the page you are currently on will continue to process. If the value is true (the default) then the page stops processing immediately.
See also the answer I gave here[^]
Man who stand on hill with mouth open wait long time for roast duck to drop in
|
|
|
|
|
Colin Angus Mackay wrote: See also the answer I gave here[^]
try{ // My code that does a redirect}catch(ThreadAbortException){ throw; // Continue throwing the ThreadAbortException}catch(Exception ex){ // Catch any other type of exception and handle the error.}
That is interesting, but I am not sure how it will work though.
In my code I use expensively try/catch. Then I have have catch all basin at the application level. Any unhandled exception will end up at the catch basin. If you rethrow the ThreadAbortException doesn't it get bubbled up. Don't you want to eat that exception?
|
|
|
|
|
Yusuf wrote: If you rethrow the ThreadAbortException doesn't it get bubbled up.
Yes, it will.
Yusuf wrote: Don't you want to eat that exception?
Nope. It is the exception that the Redirect method throws to force the end of execution. If you catch it and eat it execution resumes when you've already said you want it to stop so you can redirect elsewhere. (Although, I've been told that ASP.NET will automatically rethrow it if you catch it - which I didn't know before and wish to confirm before I change my stance as I don't see how it does it.)
Man who stand on hill with mouth open wait long time for roast duck to drop in
|
|
|
|
|
I’m building a fairly typical ASP.NET web app that has a data entry screen, a number of maintenance screens, and some reports. The data entry screen and the maintenance screens all work in the same way; they use ListView controls embedded in UpdatePanels.
So far so good – they’re solid and reliable. However, performance is an issue for the data entry screen, and I don’t think using a ListView is going to be good enough. Using Fiddler, I can see that every postback sends 30Kb of data down the line, which seems a little excessive to me.
I’ve experimented with a ‘fast’ data entry screen. This one just uses a plain ol’ table, no UpdatePanels. I handle the click event on the client side by calling a web service that updates the database. This has got me from 30Kb down to 12 bytes!
The thing is, I’d like to retain use of the ListView if possible, because I want consistency with my other screens, and I’d like to continue to use the DataPager control. To do this, I’m obviously going to need to override the __doPostBack functions that the ListView generates.
My question is, is this going to be more trouble than it’s worth? Before I waste days of my life on this, is there a much better way of going about it?
|
|
|
|
|
Well, the reason you see big chunk of data (30k) being sent is because of control viewstate[^]. You can turn off the ListView viewstate, but you will loose all the controls viewstate functionality. Do you need to remember the control state between postbacks?
|
|
|
|
|
I'm planning to avoid postbacks and ViewState altogether, and just call webmethods from the client. I know I can easily do this without using a ListView at all, but I'd like to try it with the ListView so that I can keep using the DataPager (which only works with ListView).
So my plan is to just use the ListView like a Repeater to build my table, override the __doPostBack so that it does what I want (i.e. call a webmethod rather than do a postback), and hopefully still be able to use the DataPager.
I guess I'm just asking whether anyone else has tried that approach, or can suggest a better one, before I commit loads of time to it.
|
|
|
|
|
I'm not sure what you gain by getting rid of postbacks/viewstates. If you want to mimic the look and feel, then design your ListView then see the client side generated code. I don't have .net3.5 (which ListView is supported), but, I think, it will get rendered as table. Get the table layout and structure and use straight table with some css to achieve similar look and feeling.
If you want to override postback, then prepare to write some client side code to supplement. I know you mentioned you want to call webservices. Do you need to support sorting, pagination ....
In any case see here[^] and here[^] for one way of overriding postback function
|
|
|
|
|
Thanks Yusuf. The ListView is template-based, so will generate whatever you put in the template, but yes, that's usually tables.
Thinking about it, I guess the only thing I gain by keeping the ListView is easy pagination (the DataPager control). Maybe the easiest thing will be to just abandon ListView and write my own pager.
Thanks again.
|
|
|
|
|
Hi There,
I want to how to take data into xml from database.If anybody knows some usefull links from where I can get information then please reply.
Thanks.
|
|
|
|
|
|
The treeview control has an attribute called ShowCheckBoxes which contains the values as"All,Leaf, Parent, Root and None". Because of this, I cannot add the checkboxes both for Parent and Child.
Is there anyway that I can add the checkboxes both for parent and child? Please help.
Success is the good fortune that comes from aspiration, desperation, perspiration and inspiration.
|
|
|
|
|
|
yes lol
Vuyiswa Maseko,
Few companies that installed computers to reduce the employment of clerks have realized their expectations.... They now need more and more expensive clerks even though they call them "Developers" or "Programmers."
C#/VB.NET/ASP.NET/SQL7/2000/2005/2008
http://www.vuyiswamaseko.tiyaneProperties.co.za
vuyiswa@its.co.za
http://www.itsabacus.co.za/itsabacus/
|
|
|
|
|
i am using crystal reports in asp.net. i have designed one tool bar as like crystal report.in that i have placed export button,print button..etc.
For print option I have used
dim cr as new ReportDocument
cr.PrintToPrinter(1, False, 1, 2)
The above is working when it is in debugg mode...the same print option is not working after publishing the website.
Can anyone help me????
Thanks in advance..
Regards...
Selva Shankar
modified on Monday, May 11, 2009 6:59 AM
|
|
|
|
|
SelvaShankar wrote: .the same print option is not working after publishing the website
What do you mean by not working? Getting some error?
|
|
|
|
|
no..the page is just refreshing....thats it
Thanks for your response...
Regards...
Selva Shankar
|
|
|
|
|
Hi all.
Am developing a web application. In that i placed a treeview.
Now My requirement is :
When i click on any node it should expand and already expanded nodes should be collapsed.
Please help me.
|
|
|
|