473,503 Members | 1,639 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Urgent pls: Crysta Report Login Failure

Hi,

It looks like posting a question on Sunday was not a good Idea that why I'm
trying it Today.
I'm using this code to run a crystal report and export it to pdf, and when
running it it in debug mode it working fine, but from the browser it's fails
to run telling me that the Crystal report failed to Login!!?

private void SetDBLogonForReport(ConnectionInfo connectionInfo,
ReportDocument reportDocument)
{
Tables tables = reportDocument.Database.Tables;
foreach (CrystalDecisions.CrystalReports.Engine.Table table in tables)
{
TableLogOnInfo tableLogonInfo = table.LogOnInfo;
tableLogonInfo.ConnectionInfo = connectionInfo;
table.ApplyLogOnInfo(tableLogonInfo);
}
}
private void SetDBLogonForSubreports(ConnectionInfo connectionInfo,
ReportDocument reportDocument)
{
Sections sections = reportDocument.ReportDefinition.Sections;
foreach (Section section in sections)
{
ReportObjects reportObjects = section.ReportObjects;
foreach (ReportObject reportObject in reportObjects)
{
if (reportObject.Kind == ReportObjectKind.SubreportObject)
{
SubreportObject subreportObject =
(SubreportObject)reportObject;
ReportDocument subReportDocument =
subreportObject.OpenSubreport(subreportObject.Subr eportName);
SetDBLogonForReport(connectionInfo, subReportDocument);
}
}
}
}
private void GenerateInspectionReport()
{
ReportDocument O_Report = new ReportDocument();
string strReportPath = Request.PhysicalApplicationPath +
"\\InspectionReport.rpt";
string strPDF_Path = MyPath + "\\";
O_Report.Load(strReportPath);
ConnectionInfo connectionInfo = new ConnectionInfo();
connectionInfo.ServerName = "civicview";
connectionInfo.DatabaseName = "civicview";
connectionInfo.UserID = "_SYSTEM";
connectionInfo.Password = "SYS";
SetDBLogonForReport(connectionInfo, O_Report);
SetDBLogonForSubreports(connectionInfo, O_Report);
ParameterValues currentParameterValues = new ParameterValues();
ParameterDiscreteValue parameterDiscreteValue = new
ParameterDiscreteValue();
parameterDiscreteValue.Value = "275";
currentParameterValues.Add(parameterDiscreteValue) ;
ParameterFieldDefinitions parameterFieldDefinitions =
O_Report.DataDefinition.ParameterFields;
ParameterFieldDefinition parameterFieldDefinition =
parameterFieldDefinitions["EvaluationID"];
parameterFieldDefinition.ApplyCurrentValues(curren tParameterValues);
O_Report.ExportToDisk(ExportFormatType.PortableDoc Format,
strPDF_Path + "InspectionReport.pdf");
O_Report.Close();
O_Report.Dispose();

}
Thanks

May 14 '07 #1
0 904

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

Similar topics

5
3011
by: Vishal | last post by:
Hello, I already asked this question in the ASP.NET forums, but no help came. So I am hoping that somebody can help me out. This is really very URGENT me. For my e-commerce application, I...
0
1710
by: Timmy Jones | last post by:
Hey all, I am trying to try get a crytal report running properly. A "Hello World" report that does not add criteria to the record selection formula of the report (either in the development tool,...
0
835
by: KK | last post by:
Hi, I am displaying a crystal report based on XML data In XML I will get the date in this format. <DOB>1946-05-22T00:00:00.0000000-04:00</DOB>...
0
1060
by: importantEmail | last post by:
hi i have pasted page_load, my bindgrid, sort and itemdatabound event. my sorting in not working properly...i tried a couple of ways but there is something i am missing. pls suggest me on this...
0
1179
by: samir dsf | last post by:
hi i have pasted page_load, my bindgrid, sort and itemdatabound event. my sorting in not working properly...i tried a couple of ways but there is something i am missing. pls suggest me on this...
1
1050
by: Mahesh | last post by:
Dear Sir/Madam How Can I See Second or Any Page In Asp.Net??.I Am Showing Crystal Report on Button Click. Please Mail Me at rastogi.mahesh@hotmail.com
0
1381
by: Vania | last post by:
I have develop reports in Crystall report 9 in VB.Net.Now i have install and upgrade report to Crystall report 10.Now when i run this report through project a database login dialogbox appears with...
0
958
by: =?Utf-8?B?QmFkaXM=?= | last post by:
Hi, I'm using this code to run a crystal report and export it to pdf, and when running it it in debug mode it working fine, but from the browser it's fails to run telling me that the Crystal...
1
1455
by: vbsoft | last post by:
Hello My Name is Mike Am from Nigeria a student of computer Science, Pls i want your You to help in Using VISUAL BASIC 6.0 AND MS SQL SERVER AS DATABASE AS A CLIENT SERVER SIDE pLS: I...
0
7202
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,...
0
7328
jinu1996
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...
0
7458
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...
0
5578
agi2029
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,...
1
5013
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...
0
4672
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...
0
3167
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...
0
1512
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 ...
0
380
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...

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.