?
Solved

SAP Crystal reports 2011, IIS 7.5

Posted on 2013-12-18
10
Medium Priority
?
1,052 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 101

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 101

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
The 14th Annual Expert Award Winners

The results are in! Meet the top members of our 2017 Expert Awards. Congratulations to all who qualified!

 

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 101

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 101

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: Port Scanner

Check which ports are open to the outside world. Helps make sure that your firewall rules are working as intended.

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.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

Lync server 2013 or Skype for business Backup Service Error ID 4049 – After File Share Migration
A phishing scam that claims a recipient’s credit card details have been “suspended” is the latest trend in spoof emails.
SQL Database Recovery Software repairs the MDF & NDF Files, corrupted due to hardware related issues or software related errors. Provides preview of recovered database objects and allows saving in either MSSQL, CSV, HTML or XLS format. Ensures recov…
Stellar Phoenix SQL Database Repair software easily fixes the suspect mode issue of SQL Server database. It is a simple process to bring the database from suspect mode to normal mode. Check out the video and fix the SQL database suspect mode problem.

569 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