Quantcast
Channel: SCN : Discussion List - SAP Crystal Reports, version for Visual Studio
Viewing all 3636 articles
Browse latest View live

Crystal Reports not showing report on ActionResult MVC3

$
0
0

After tryingseveral optionsI fail todeploya report andI am not gettinganyspecific error.


I am developingin VisualStudio 2010withMVC3Razor.


I havea viewto invoice

This is part of the view:

@model Models.FacturaHeaderModel
@{    ViewBag.Title = "Facturación de Compras";    Layout = "~/Views/Shared/_Layout.cshtml";    }
@using (Html.BeginForm("Guardar", "Facturas", FormMethod.Post, new { id = "factura" }))
{    <fieldset>        <div class="editor-label" style="font-size:16px;">            @Html.LabelFor(m => m.Movimiento.DescripLarga)            <div class="editor-field">                @Html.TextBoxFor(m => m.Movimiento.DescripLarga, new { @readonly = "readonly", style = "font-weight: bold;font-size:16px;" })            </div>        </div>
....    </fieldset>        <input type="submit" name="Guardar" id="guardar" title="Guardar" value="Guardar" />
}

 

This is part of ActionResult

[AcceptVerbs(HttpVerbs.Post)]
public ActionResult Guardar(FacturaHeaderModel model, FormCollection formCollection)
{            if (ModelState.IsValid)            {
..... save data.......                var reporte = System.Web.HttpContext.Current.Request.PhysicalApplicationPath + @"rpt\Factura.rpt";                var rptH = new ReportClass { FileName = reporte };                rptH.Load();                var cnn = new ReportHelper();                cnn.Connect(ref rptH); //connect database                rptH.RecordSelectionFormula = "{CtaCteCliente.CtaCteClienteId}=" + facturaId;                var stream = rptH.ExportToStream(ExportFormatType.PortableDocFormat);                return File(stream, "application/pdf");            }
}

 

For some reasonthough thereport is designedproperly andfrom the designerworking properlyand after makingseveral attempts todebug thecode to detectthat is wrongdoes not seem tobeanything unusual.

Some queries:
This error maybe caused bythe type of responseexpected byvisual studio?

Is there anyway to getcrystal reportserrorin previousversionsassomething like:

rptH.LastError

Error 1935 when installing CRRuntime_32bit_13_0.msi

$
0
0

I am getting Error 1935 - An error occurred during installation of an assembly component. The PC has Windows Vista 32 bit.

I downloaded CRRuntime_32bit_13_0.msi from the link provided and tried to install to on my pc.

Is there a newer update? Is this a known issue?

Set "No Printer" at runtime

$
0
0

I am looking for a way to programatically set the "No Printer (optimize for screen display)" feature found in the Page Setup menu of the IDE.  I've looked at the CrystalDecisions.ReportAppServer.ReportDefModel.PrintOptions object and other similar items available to me in .NET, but I don't see a way of changing this.  Does anyone know a way of doing this?

 

We are using Visual Studio 2003 and Crystal Reports 2008, full version.

 

Thanks!

Chuck

Print button not working, and export shows the dialog but not working when click export

$
0
0

Hi,

I need some help from you.

 

My report is working in my development machine.

 

When I move it to the production machine, all is working correctly, except this:

 

1. When click on Print button nothing happens.

2. When click on Export button, the export dialog appears, but when I select an export type and click on Export button, nothing happens.

3. When click on the Next Page button, the seacrhing next page dialog appears, but neves disappears, and never show the next page...

 

These are the simptoms i have noticed.

It seems something with JavaScript, but not sure...

Can anybody tell me what to try to solve the problem?

Thanks!

ODBC Connection Saved in Reports

$
0
0

Hey everyone,

 

I work with CR8 for several years now and, once again, it's time to upgrade our reporting tool.

 

Some years ago we tried a newer version of CR, when it belonged to Business Objects if I'm not mistaken.

 

Everything went well until we came up with an error that made us go back to CR8.

 

What happened was that our CR reports, designed with an ODBC connection to an iSeries Server got stored the info about the system and the libraries, which unabled us to distribute the rpt's to our costumers.

 

To exmplain better, designing a report to read data from a table X, on library Y, on system Z, the location of the table on CR would look something like this: "Z.Y.X" and there was no chance to change this, as we do so far, clearing at least the system name making the location of the table as "Y.X".

 

This also happened with an ODBC connection to an SQL Server as the report would save at least the database name (cant remember if it stored the machine name).

 

As you can imagine, this way we have no chance of distributing our ERP to our customers as the RPT's would not show any data at all because they would be "pointing" to machines/libraries/databases that didn't existed!

 

Suppport at that time said that this was no error, this was just the way CR worked, regardless of me saying that it was an error of previous CR versions, meanwhile fixed.

 

My question is simple: is this the way CR actually still works? If build a RPT, pointing to a system, library and table, will this info be saved on the rpt giving me no change this and therefore giving me no chance to distribute the RPT?

 

Note: with our current version, we only have to have an ODBC poiting to the iSeries/SQL Server, with the correcte libraries/databases.

Many thanks in advance,

ADO.NET Datasource, getting Logon Failed

$
0
0

I have worked my way through the samples and walk-throughs in the blogs and help docs on this site to create a report that is based on an ADO.NET Dataset (XML xsd file).

 

My actual data dataset is generated from a STored procedure and a command/adapter object. I then set the SetDataSOurce of the report to the dataset created from the stored procedure.

 

My DB is MySQL

 

Every time I set the reportsource of the viewer to my report document and view the report it says login failed.

 

Why?

 

My XSD is just created by hand, no DB connections. It has just 2 fields, login name and last login date. Fields are named exactly as in the DB. In fact if I comment out the line that does 'SetDataSource' for the report and just show the report with no data, just as it comes, it still says Login Failed.

 

What is happening? Why is it wanting to login to show a report that has no data other than what is defined in the xdd, which is nothing. There is no data attached to the report in design time. If I preview I just get a list of VB colours which I guess is some kind of design time placeholder.

 

I just dont know what is going on but this is putting a major project in jeopardy. I have 5 working days to get this working and deliver 20 reports. Otherwise my Customer will cancel. I moved to Crystal from a competitors product thinking it would be easier and faster. I hope I didnt make a big mistake..

 

Please can someone help me get this working so I can get going on my report designs and deliver this project

Thanks

Mark

SAP Crystal Reports Viewer 2012 cannot display justified text ¿For why?

$
0
0

Hello all, I'm new here

 

Actually, me and my group of developers has a problem with SAP CR 2012 (with visual studio 2012) and the justify text on web reports. We have a various text elements on the report. This, contais a text stored in a DataBase.

 

We put the simple properties, on field, right click, text justify and too, Paragrhap, text as HTML format, previouslyplacingthe text string, <divstyle="text-align:center">TEXT</ div>, but that does not work.

When I look atthe HTML outputto the Web,I see thetext in the fields, is being mountedasa <span>andthis, not supportedin any wayjustified text.

What would bethe correct way tojustifytext inthis version ofSAPCR?

thanks

Justified text displaying error

$
0
0

Hi,

 

I've found that justified text in a report wasn't formatted as well.

 

I have CR 2008 with SP1, SP2 and SP4, and I'm tryin' to display a justified text report, within a .NET WebPage developed with Visual Studio 2010.

 

What I have to do??

 

Thanks,


Failure to retrieve data from the database (Vendor Code 6550)

$
0
0

I am having a trouble with two of the 6 reports that I have created. I am using Crystal XI and Oracle 10g. The underlying database object is a stored procedure that accepts as input a start time as a TIMESTAMP, an end time as a TIMESTAMP and a furnace number as a number. I have a cursor ref as a return parameter.

 

When I run the stored procedure in Oracle I get the selected records and can view them on the screen.

 

When I refresh data on the report in Crystal XI developer, the designer asks me for the start and end time and furnace number. When I input these values the report displays properly.

 

When I launch the report from my VB .NET 2005 application I am asked for the username and the password for the database (this is another problem I need to solve as this information I put into the program seems to be ignored in my program) then I receive the following failure message:

 

Failure to retrieve data from the database (Vendor Code 6550)

 

When I launch the other reports, they only ask me for the username and password then they display the proper data.

 

The main difference between my other reports and the two that are returning the above failure code is that the other reports are to either tables or views. The two that don't work are tied to stored procedures. I there any way that I can solve this problem or at least get more information?

 

Any help would be greatly appreciated. Let me know if you need any other information.

IIS Server deployment run time files and bit ness.

$
0
0

Hi

 

I have been developing an ASP.NET application and using CR as the reporting solution.

 

So far so good in the dev environment. Now it is time to push it out to the real world (or at least to test).

 

I am a bit confused about the process for deploying such a beast onto a Windows IIS web server. Whar runtimes do I need, where are they, which versions. Is it a one-shot installer or do I need to deploy various components.

 

I have trawled around but cant find a nice clear guide of how to do this.

 

And there is also the added complication of bit-ness. (at least I think there is)

 

Here is where I am at

 

1. App developed on 32 bit windows machine

2. Server for target is Windows 2008 64 bit

3. So assume IIS is also 64 bit version (is that true??)

4. So I assume I deploy my app as 32 bit and use 32 bit CR run times, but really not sure.

 

Any guidance musch appreciated

Thanks

Mark

CR Runtime for .net 64bit fails on SetTableLocation

$
0
0

We are porting currently our c++ application from Win 32 to Win 64 bit and want to use the new runtime to generate reports.

Runtime: CRRuntime_64bit_13_0_3.msi

 

The reports are based on a sql query command on ODBC database connection (MS SQL or Oracle) .

Our application replaces by API call the stored ODBC database with production database during execution/exporting of the reports.

 

We always got error as follows when executed a report at 64bit platform:

 

System Exception Handler: System.Runtime.InteropServices.COMException (0x800002CD): Failed to load database information.

Error in File EventDensity {4B302108-644E-4E2D-9EFA-3418FB4FAFA9}.rpt:

Failed to load database information.

   at CrystalDecisions.ReportAppServer.Controllers.DatabaseControllerClass.SetTableLocation(ISCRTable CurTable, ISCRTabl

e NewTable)

   at CrystalDecisions.CrystalReports.Engine.Table.set_Location(String value)

   at ReportGen.exportReport()

Destruct ReportGen

CmdCrystalReport FncFreeFunctionData

 

But if we compile our application as 32bit and use CRRuntime_32bit_13_0_3, report is generated correctly.

 

Any Idea whats wrong?

 

Here is a part of or source code that we use to set the runtime database connection and try to exprt the report:

 

BOOL exportReport()

      {

try

{

//Setup the connection information structure to be used

//to log onto the datasource for the report.

crConnectionInfo = new ConnectionInfo ();

crConnectionInfo->ServerName = pconf->getConnectDSN();      //physical server name or odbc DSN

ProviewDBConnection* pDBConn = pconf->getProviewDBConnection();

crConnectionInfo->DatabaseName = pDBConn->getDatabaseName();      // use the default database

crConnectionInfo->UserID = pconf->getConnectUID();

crConnectionInfo->Password = pconf->getConnectPWD();

 

//Get the table information from the report       

crDatabase = crReportDocument->Database;

  crTables = crDatabase->Tables;

 

//Loop through all tables in the report and apply the connection

//information for each table.

for (int i = 0; i < crTables->Count; i++)

{

crTable = crTables->Item [i];

crTableLogOnInfo = crTable->LogOnInfo;

crTableLogOnInfo->ConnectionInfo = crConnectionInfo;

crTable->ApplyLogOnInfo(crTableLogOnInfo);

crTable->Location = crTableLogOnInfo->TableName->Substring(crTableLogOnInfo->TableName->LastIndexOf(".") + 1);

//crTable->Location = crTableLogOnInfo->TableName->ToUpper();

}

exportPath = exportPath->Insert(exportPath->Length ,S".");

exportPath = exportPath->Insert(exportPath->Length ,exportFileSuffix);

Console::Write("Exporting to ");

Console::Write(exportPath);

Console::WriteLine();

 

crReportDocument->ExportToDisk(exportFormat, exportPath);

 

}

catch(Exception* e)

{

Console::WriteLine(S"System Exception Handler: {0}", e);

TrcPrintfEx(PV_TRC_UTI, TRC_LVL_ERR,

"ReportGen::export() System exception:\n"

"Message:\n%s\nStacktrace:\n%s",

e->Message,e->StackTrace);

errorMessage = "Error:\n";

errorMessage = errorMessage->Insert(errorMessage->Length, e->Message);

String* newLine = "\nStackTrace:\n";

return FALSE;

}

return TRUE;

}

Unable to run visual studio 2010 project

$
0
0

I have window7 64 bit machine, I have installed visual studio 2010 32 bit and crystal report 11 relse2 32 bit on this machine.

Every time I try to run the project from visual studio 2010, I get build error as below.

'CrystalDecisions.Windows.Forms.CrystalReportViewer' is not defined. C:\Fire Studio 2010\FireProject 2010\frmIInspectionInfo.vb 3298 47 FireProject.

Problem inserting image dynamically into crystal report.

$
0
0

Hello,

I'm using Crystal Reports in an application and I don't seem to be able to insert a dynamic image into said report.

I've tried creating a formula field to store the path to the image I want to display and then getting another image as placeholder and setting the "Graphic Location" of that image as the path saved in the formula field I created. This seems to work in the CR editor, however, it doesn'twork when I'm using a reportviewer in my application (it displays the placeholder instead of the dynamic image).

 

Is there any way to solve this problem?

 

For completeness: I'm using Crystal Reports XI and Microsoft Visual Studio 2008.

Floating point rounding error in CR2011

$
0
0

Hi All,

 

I just upgraded our CrystalReports from 2008 to 2011, but I found there are some floating point rounding errors happened in the reports generated by the CR2011 (using "SAP Crystal Reports, developer version for Microsoft Visual Studio" libraries). The following is the example:

 

 

There is a field in my report (in fact, is a sub-report) to display (with 2 decimal points) the result output of my "sp_xxx;1.mLiab", and the following are its output values:

 

2008596.2770

1104305.8400

342524.3890

167207.5140

87253.0120

15414.4130

0.0000

 

And, there is another field in my report to display (with 2 decimal points) the sum up value of the output of my "sp_xxx;1.mLiab". The displayed value should be 3725301.45 in theory (as it is truncated from the actual summation output -> 3725301.445), but I found the CR2011 output me the wrong result 3725301.44. I have also tried to generated the same report by using CrystalReports 2008 and CrystalReports XI, and they also output me a correct value.


Does any one know what is the problem? Is it a bug? or, anything I configured in wrong way? Thanks in advance.


Cheers,

Elliott

Report not showing in reportviewer, just vertical grey bars.

$
0
0

I created two reports, one in Microsoft reporting services and the other with crystal reports.  I use the same dataset to pass to both.  The Microsoft report displays fine, the crystal report viewer however just displays a pattern of vertical grey bars (see at bottom).

 

My code is below:

 

         

OdbcConnection conObj = newOdbcConnection("");


conObj.ConnectionString =  @"Driver={Microsoft Access Driver (*.mdb, *.accdb)};Dbq=C:\webDev\test.accdb;";


conObj.Open();


String sqlStmt = "my select statement here: removed on purpose";

           

OdbcCommand cmd = newOdbcCommand(sqlStmt,conObj);


OdbcDataAdapter da = newOdbcDataAdapter(cmd);


testData ds = newtestData();


da.Fill(ds, "CMR_testData");



// record count is showing 2 records

int rc = ds.Tables["CMR_testData"].Rows.Count;


           

CrystalReport1 oRpt = newCrystalReport1();

 

oRpt.Database.Tables[0].SetDataSource(ds);



CrystalReportViewer1.ReportSource = oRpt;


CrystalReportViewer1.RefreshReport();

 

conObj.Close();

 

 

Here is what I see:


crystal_report.PNG

 

Hopefully someone can shed some light on what I am doing wrong.

 

Thanks,

Garth


ADO.NET: Exception...target of an invocation, when using WebConfigurationManager outside of Try Catch

$
0
0

I’m in the process of creating several Crystal Reports that will use an ADO.NET datasources that were generated using datasets generated from a classes shared functions .  When creating my second report, Crystal Designer reported an error after choosing the method from my new class.  The error was:

“Login Failed.  Details: mscorlib: Exception has been thrown by the target of an invocation.”

I didn’t have this issue at all with my first report.  To validate the dataset, I created a test web page which I linked the same dataset to a data grid and it worked just fine.

It took me a while, comparing the code between my classes and changing the new class one line at a time to match the working class, but I figured out the cause.  In my new class, I was using multiple databases for the source of creating the dataset being returned in my new class.  As part of that, I was making a call to get the connection string to the database from my web.config.  Basically this line was causing the error:

Dim ConnStr as String = WebConfigurationManager.ConnectionStrings.Item("oConnectionString").ToString()

I found if I wrapped it in a Try Catch, the error went away when trying to link to it in CR Designer.  I had all my other .NET calls wrapped in a Try Catch in my first class and that is why I didn’t get this error before.  This one was not easy to figure out the conditions as to how “make things work”.  The error message was little to generic to even suggest what was wrong too.

I am still puzzled as to why a Try Catch fixed the issue with CR Designer though.  Also I would like to know if the code really was my in error or is this a bug in CR Designer.

I've attached sample code images of the error.

Page orientation and size when printing to Zebra

$
0
0

We use an ERP system called ECi M1 to print the reports developed with Crystal Reports 2008.  I have random label reports that begin not to work for some reason.  They preview incorrectly in the ERP system and print on multiple labels. See attached screen shot..  I've seen other threads regarding this, but they say to do the below.

 

"Apply SP 3:

https://smpdl.sap-ag.de/~sapidp/012002523100007123572010E/cr2008_sp3.exe

 

Then FP 3.1:

https://smpdl.sap-ag.de/~sapidp/012002523100010605962010E/cr2008sp3_fp31.exe

 

Runtime can be downloaded from the downloads web page:

https://websmp230.sap-ag.de/sap(bD1lbiZjPTAwMQ==)/bc/bsp/spn/bobj_download/main.htm

 

Ludek"

 

 

However, I downloaded the SP 3 and I received an error that something was corrupt.  I am concerened that I may do something which will make my ERP system and Crystal not function together.  I'm also not sure about upgrading Runtime.  Not sure what it does or where it is located.

 

Any help would be appreciated.

 

Brad.

.NET SDK vs RAS SDK

$
0
0

Hi,

 

We've been using the .NET SDK for a while and I'm looking at changing to the RAS SDK.  We don't use Crystal Server very much and none of our .NET applications use any reports on the Report Server.  We develop for both Windows and Web via ASP. 

 

Is there an advantage to using RAS?  I know performance should be enhanced with the RAS but any other reason to change? 

 

Thanks,

Brian

The report you requested requires further information.

$
0
0

Hi

 

 

I created report in asp.net,c#

 

 

every time  when i run the report it asks

" The report you requested requires further information.

 

Server Name,Database Name,User Name,Password"

 

 

I have written the code given below

 

 

SqlConnection con = new SqlConnection(GetConnectionString());

                con.Open();

                try

                {

 

 

                    string statement = " select a.CustomerNo,"

                                 + " CASE  WHEN  cd1.ContactType =1 "

                            + " THEN cd1.CustomerName "

                            + " ELSE cd1.CustomerName + ' /  ' + cd1.CompanyName end as ContactDetails,"

            + "  a.customerno,a.subject,a.mailto,cd1.companyname,"

            + "   a.MeetingDate,a.MeetingType,a.subject,a.minutesofdiscussion,a.actiontaken ,"

            + "   a.result,a.FollowupDate,a.FollowupAction,a.attendies,a.Isactive,a.EmployeeName"

            + "    from ( select  customerno ,mailto,convert(varchar,fu.MeetingDate,105) as MeetingDate,"

            + "      MeetingType,Subject,MinutesofDiscussion, Actiontaken,Result,FollowupDate,FollowupAction,"

            + "         attendies,fu.Isactive,ud.EmployeeName    from followup fu left outer join"

            + "      userdetails ud on fu.mailto=ud.UNo) a,customerdetails cd1 where a.customerno= cd1.customerno";

 

 

 

 

 

 

                    string whereConcatenator = "  And ";

                    if (Request.QueryString["prmCustomerNo"] != "0")

                    {

                        statement += whereConcatenator;

                        statement += "cd1.RelatedTo= " + Request.QueryString["prmCustomerNo"] + " ";

                        whereConcatenator = "AND ";

                    }

 

 

 

 

                    if (Request.QueryString["prmCustomerNo"] != "0")

                    {

                        statement += whereConcatenator;

                        statement += " a.CustomerNo = " + Request.QueryString["prmCustomerNo"] + " ";

                        whereConcatenator = "AND ";

                    }

                    if (Request.QueryString["prmCompanyNo"] != "0")

                    {

                        statement += whereConcatenator;

                        statement += " a.MailTo = " + Request.QueryString["prmCompanyNo"] + " ";

                        whereConcatenator = "AND ";

                    }

                    statement += " order by  a.EmployeeName  ";

                    SqlCommand cmd = new SqlCommand(statement, con);

                    SqlDataAdapter sda = new SqlDataAdapter(cmd);

                    DataTable dt = new DataTable();

                    sda.Fill(dt);

 

 

 

 

                    if (dt.Rows.Count > 0)

                    {

                        TableLogOnInfo crTableLogOnInfo = new TableLogOnInfo();

                        ConnectionInfo crConnectionInfo = new ConnectionInfo();

                        CrystalDecisions.CrystalReports.Engine.Database crDatabase;

                        CrystalDecisions.CrystalReports.Engine.Tables crTables;

                        ReportDocument doc = new ReportDocument();

                        doc.Load(Server.MapPath("CrystalReport.rpt"));

                        var connectionInfo = new ConnectionInfo();

                        connectionInfo.ServerName = "ccc.com";

                        connectionInfo.DatabaseName = "xxx";

                        connectionInfo.Password = "ssss";

                       

                        connectionInfo.UserID = "ttt";

                        connectionInfo.Type = ConnectionInfoType.SQL;

                        connectionInfo.IntegratedSecurity = true;

 

 

 

 

                        for (int i = 0; i < CrystalReportViewer1.LogOnInfo.Count; i++)

                        {

                            CrystalReportViewer1.LogOnInfo[i].ConnectionInfo = connectionInfo;

                        }

 

 

                        doc.SetDataSource(dt);

                        CrystalReportViewer1.ReportSource = doc;

Please help me to avoid the entry of Server Name,Database Name,User Name,Password

 

 

Thanks

 

 

Chandran

Creystal report print button problem

$
0
0

crystal report in Windows 7  64x Platform  print Button Not work , i must install visual studio and Chose Crysal report From Custom installation And install Crystal report Service pack 1

i looking for one Packge to install or fix it Within  Visual Studio

 

Thanks

Viewing all 3636 articles
Browse latest View live


<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>