Solved

SAP Crystal reports 2011, IIS 7.5

Posted on 2013-12-18
10
962 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
Comment Utility
How are they running the reports?

IS there an application that runs them?

mlmcc
0
 

Author Comment

by:D_Batona
Comment Utility
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
Comment Utility
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
Comment Utility
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
Comment Utility
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
How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

 

Author Comment

by:D_Batona
Comment Utility
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
Comment Utility
Actually just set 32 bit ODBC. Same shit..
0
 
LVL 100

Expert Comment

by:mlmcc
Comment Utility
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
Comment Utility
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
Comment Utility
we just found a solution
0

Featured Post

What Is Threat Intelligence?

Threat intelligence is often discussed, but rarely understood. Starting with a precise definition, along with clear business goals, is essential.

Join & Write a Comment

SQL Server engine let you use a Windows account or a SQL Server account to connect to a SQL Server instance. This can be configured immediatly during the SQL Server installation or after in the Server Authentication section in the Server properties …
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…
Internet Business Fax to Email Made Easy - With eFax Corporate (http://www.enterprise.efax.com), you'll receive a dedicated online fax number, which is used the same way as a typical analog fax number. You'll receive secure faxes in your email, fr…
This tutorial demonstrates a quick way of adding group price to multiple Magento products.

771 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

14 Experts available now in Live!

Get 1:1 Help Now