• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 1032
  • Last Modified:

SAP Crystal reports 2011, IIS 7.5

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
D_Batona
Asked:
D_Batona
  • 6
  • 4
1 Solution
 
mlmccCommented:
How are they running the reports?

IS there an application that runs them?

mlmcc
0
 
D_BatonaAuthor Commented:
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
 
mlmccCommented:
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
What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

 
D_BatonaAuthor Commented:
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
 
mlmccCommented:
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
 
D_BatonaAuthor Commented:
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
 
D_BatonaAuthor Commented:
Actually just set 32 bit ODBC. Same shit..
0
 
mlmccCommented:
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
 
D_BatonaAuthor Commented:
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
 
D_BatonaAuthor Commented:
we just found a solution
0

Featured Post

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

  • 6
  • 4
Tackle projects and never again get stuck behind a technical roadblock.
Join Now