Solved

SAP Crystal reports 2011, IIS 7.5

Posted on 2013-12-18
10
988 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
Enterprise Mobility and BYOD For Dummies

Like “For Dummies” books, you can read this in whatever order you choose and learn about mobility and BYOD; and how to put a competitive mobile infrastructure in place. Developed for SMBs and large enterprises alike, you will find helpful use cases, planning, and implementation.

 

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
 

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

Free Tool: Site Down Detector

Helpful to verify reports of your own downtime, or to double check a downed website you are trying to access.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

Occasionally there is a need to clean table columns, especially if you have inherited legacy data. There are obviously many ways to accomplish that, including elaborate UPDATE queries with anywhere from one to numerous REPLACE functions (even within…
A phishing scam that claims a recipient’s credit card details have been “suspended” is the latest trend in spoof emails.
Although Jacob Bernoulli (1654-1705) has been credited as the creator of "Binomial Distribution Table", Gottfried Leibniz (1646-1716) did his dissertation on the subject in 1666; Leibniz you may recall is the co-inventor of "Calculus" and beat Isaac…

860 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