Solved

SAP Crystal reports 2011, IIS 7.5

Posted on 2013-12-18
10
975 Views
Last Modified: 2013-12-24
Ok, we got the reports working on our web-server. Thank you for the help.
The only issue is when client run report from browser he will get the window asking the password, see attached. After he types the password data is pulled from data base and everything is ok.
It looks it is ODBC issue as actual data base is located on different server.
When I remove the connection from "System DSN" report will not run at all .
Our developer has 2 ODBC set on his machine -"System DSN" and "User DSN". Everything is working fine on his PC.
As website is running under some virtual account IIS creates automatically I dont have option to create ODBC connection in "User DSN" for that account.
Actually I would like to avoid using ODBC connection at all.
I guess that some string needs to be added to aspx file which trigger rpt file or rpt file needs to be saved with proper connection to DB on developer PC.
Please suggest.
Untitled.jpg
0
Comment
Question by:D_Batona
  • 6
  • 4
10 Comments
 
LVL 100

Expert Comment

by:mlmcc
ID: 39727623
How are they running the reports?

IS there an application that runs them?

mlmcc
0
 

Author Comment

by:D_Batona
ID: 39727638
Hi ,
Please see aspx code

<body>
    <form id="form1" runat="server">
 
   <div>
      <CR:CrystalReportViewer ID="rptViewer" runat="server"
      HasToggleGroupTreeButton="False"
        HasToggleParameterPanelButton="False"  EnableDatabaseLogonPrompt="true"
        GroupTreeImagesFolderUrl="" Height="1202px"
        ToolbarImagesFolderUrl=""  
        ToolPanelWidth="200px" Width="868px"
        ReuseParameterValuesOnRefresh="True" AutoDataBind="True"  DisplayToolbar="True"  DisplayStatusbar="true"
         HasDrilldownTabs="True" HasDrillUpButton="True" HasGotoPageButton="True"
         SeparatePages="True" ToolPanelView="GroupTree"
        ReportSourceID="CrystalReportSource1"
        />
        <CR:CrystalReportSource ID="CrystalReportSource1" runat="server">
       
        </CR:CrystalReportSource>
       
     
    </div>
    </form>
</body>

and Cs code

 protected void Page_Load(object sender, EventArgs e)
{
CrystalReportSource1.ReportDocument.SetDatabaseLogon("username", "userpassword", "servername", "database name",true);
}
0
 
LVL 100

Expert Comment

by:mlmcc
ID: 39727704
I have seen methods in other languages that set the logon information for each table rather than setting it through the SetDatabaseLogon method which as I recall was kept around to maintain compatibility with previous versions.

I don't have an example here but will try to find one.

Crystal allows you to use 2 methods for getting data to the report, push and pull.  You are using the pull method which is easier in the report development stage but much more difficult for the application and changing of databases.  The push method builds the report using a dataset which the application can then fill with data.  The application worries about what database and connecting to it which is much easier to control.

Depending on how many reports you have it may be worthwhile looking into it.  To use the push method you may have to rebuild the reports.

Basic method
http://www.emoreau.com/Entries/Articles/2006/09/Feeding-Crystal-Reports-from-your-application.aspx

Exporting
http://www.emoreau.com/Entries/Articles/2006/10/Crystal-Reports--Part-II.aspx

mlmcc
0
 

Author Comment

by:D_Batona
ID: 39727726
Hi ,
This is an example to do it by tables
ReportDocument cryRpt = new ReportDocument();
            TableLogOnInfos crtableLogoninfos = new TableLogOnInfos();
            TableLogOnInfo crtableLogoninfo = new TableLogOnInfo();
            ConnectionInfo crConnectionInfo = new ConnectionInfo();
            Tables CrTables ;
           
            cryRpt.Load(Server.MapPath("..\\RPT\\Report2.rpt"));
           
           
            crConnectionInfo.ServerName = "ServerName";
            crConnectionInfo.DatabaseName = "DatabaseName";
            crConnectionInfo.UserID = "UserID";
            crConnectionInfo.Password = "Password";

            CrTables = cryRpt.Database.Tables ;
            foreach (CrystalDecisions.CrystalReports.Engine.Table CrTable in CrTables)
            {
                crtableLogoninfo = CrTable.LogOnInfo;
                crtableLogoninfo.ConnectionInfo = crConnectionInfo;
                CrTable.ApplyLogOnInfo(crtableLogoninfo);
            }

            rptViewer.ReportSource = cryRpt;
           rptViewer.RefreshReport();

Still getting error (Another one)
Please see attached file
error.png
0
 
LVL 100

Expert Comment

by:mlmcc
ID: 39727992
Should have asked this at first.  Is the server 64-bit?  If so did you build the ODBC connections with the 32-bit ODBC manager (in SYSWOW64)

mlmcc
0
Zoho SalesIQ

Hassle-free live chat software re-imagined for business growth. 2 users, always free.

 

Author Comment

by:D_Batona
ID: 39728023
Both servers , WEB and SQL Data base are Server2008R2 x 64.
We just set ODBC from "Administrative tools".
Should we care about 32 bit?
When I set application pool to support 32 bit as some people suggested we can't even see the web page.
0
 

Author Comment

by:D_Batona
ID: 39728209
Actually just set 32 bit ODBC. Same shit..
0
 
LVL 100

Expert Comment

by:mlmcc
ID: 39728442
Are you using the stand-alone full version of CR 2011?
If so there is no SDK for it.  I believe you cannot use it in an application.

Have you tried using the Crystal for your versioin of VS?

mlmcc
0
 

Accepted Solution

by:
D_Batona earned 0 total points
ID: 39729562
Ok, we fixed it.
Here what we did:
ODBC connection was removed complicatedly from Web server , both 32 bit and 64 bit.
Developer create new rpt file using OLE DB as per
http://www.youtube.com/watch?v=5XQT3uifiCw
Another trick you need to install SQL Server 2008 R2 Native Client on Web server , then it will use it to connect to SQl server to pull data for report.

P.S. We used full version CR2011 on developer machine , we installed CRforVS_redist_install_64bit_13_7 on  WEb server.

Everything is working now.
Thank you.
0
 

Author Closing Comment

by:D_Batona
ID: 39737627
we just found a solution
0

Featured Post

Optimizing Cloud Backup for Low Bandwidth

With cloud storage prices going down a growing number of SMBs start to use it for backup storage. Unfortunately, business data volume rarely fits the average Internet speed. This article provides an overview of main Internet speed challenges and reveals backup best practices.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

In this article we will get to know that how can we recover deleted data if it happens accidently. We really can recover deleted rows if we know the time when data is deleted by using the transaction log.
Ever needed a SQL 2008 Database replicated/mirrored/log shipped on another server but you can't take the downtime inflicted by initial snapshot or disconnect while T-logs are restored or mirror applied? You can use SQL Server Initialize from Backup…
Migrating to Microsoft Office 365 is becoming increasingly popular for organizations both large and small. If you have made the leap to Microsoft’s cloud platform, you know that you will need to create a corporate email signature for your Office 365…
In this video I am going to show you how to back up and restore Office 365 mailboxes using CodeTwo Backup for Office 365. Learn more about the tool used in this video here: http://www.codetwo.com/backup-for-office-365/ (http://www.codetwo.com/ba…

910 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

19 Experts available now in Live!

Get 1:1 Help Now