Modify datasource on reports

I am pretty new to crystal reports. I have inherited around 500 crystal reports where the datasource location is a ODBC(RDO) but pointing to actual databaseserver and databasename. Properties on the datasource look as follows:
Database Tyoe: ODBC(RDO)
Server Name: XYZ
User ID : User
DataBase: XYZ
User DSN Default Properies: True
We recently moved to a new database server and the database name is also changed so we would like the datasource on the report to be like this:
Database Tyoe: ODBC(RDO)
Server Name: ABC
User ID : User
DataBase: NewDB
User DSN Default Properies: True
I used the code following code on all the rpt files to change the information. But when I open the report after running the script it is still showing the old database information.
report.Load(@"C:\Development\Crystal Test\report1.rpt");
// Change the server name and database in main reports
foreach (CrystalDecisions.Shared.IConnectionInfo connection in report.DataSourceConnections)
if ((String.Compare(connection.ServerName, "XYZ", true) == 0) &&
(String.Compare(connection.DatabaseName, "XYZ", true) == 0))
report.DataSourceConnections("XYZ", "XYZ").SetConnection(
"ABC", "NewDB", "User", "");
On further research I found that this will change on the temporary copy of the report but not on actual. Is there anyway to change the database information on all the of the 500 reports without doing manually? I really appreciate your help.
Also I am not sure if the original developer has used a DSN or the connection string in the datasource. Is there a way to know it or differentiate between various odbc(rdo) database types?
Thanks in advance

Let me see if I understood the question, you are wanting to change the connection within the rpt file so that when you open it later, you don't need to change it?  You would want to look at the ReportDocument.SaveAs method to make this change permanent.

Similar Messages

  • Issue while opening SSRS Report with Oracle as Datasource in Report Manager

    I deployed SSRS report in Report Manager but I am unable to generate that report. Am getting following error.
    Is it problem with datasource in report manager? I am not able to change the Data source type to Oracle. It is showing Microsoft SQL Server. How can I change it, no other options are coming except Microsoft SQL Server. Please help.
    An
    error has occurred during report processing. (rsProcessingAborted)
    Cannot
    create a connection to data source 'TEST_DS'. (rsErrorOpeningConnection)
    For
    more information about this error navigate to the report server on the local
    server machine, or enable remote errors

     When I deploy them in localhost, and try to run report in report manager, it is not showing any data source type in drop down list except MS SQL Server. I do not know why it is showing in BIDS and not in report manager!!!
    Hello,
    Based on my test, I can specify the data source type as Oracle after deploy the report to Report Manager and open the report Data source propertity page. If the report use the shared data source, you should check the specify data source at the Data Source
    folder. Please refer to the following screen shot:
    Regards,
    Fanny Liu
    Fanny Liu
    TechNet Community Support

  • Error in RSS file when setting datasource in report

    Hi,
    I trying to prepare script to deploy my reports to reporting service 2008. Script is takes from
    this question (Deploying Reports rss). Unfortunately code provided for data sources settings is not working in my case and I do not know why.
    Sequence is following: removed reports path, re-craete it, create datasource and for each report following actions performed: deploy and set datasource.
    After first report tried to set data source in itself scripts failed with error:
    D:\_ST\FLASH>rs -i deploy.rss -s http://localhost/ReportServer_i2008
    Parent folder Pipeline Reports created successfully.
    Deploying report 'CRM Practice Report'
    Report: CRM Practice Report published successfully.
    Setting datasource to report 'CRM Practice Report'.
    Error setting datasource to report 'CRM Practice Report'
    ERROR while Publishing report: CRM Practice Report
    Unhandled exception:
    The data source 'Warehouse Datasource' cannot be found.
    Here is the script I using to deploy datasource and reports:
    Dim definition As [Byte]() = Nothing
    Dim warnings As Warning() = Nothing
    Dim destinationFolder As String = "Pipeline Reports"
    Dim reportsTargetPath As String = "/" + destinationFolder
    Dim reportsSourcePath As String = "D:\Depot\Internal\BDW\BDW_Phase4\Src\BDW_R4.17.2\Reports\BDW_Reports"
    Dim datasourceName As String = "Warehouse Datasource"
    Public Sub Main()
    Try
    rs.Credentials = System.Net.CredentialCache.DefaultCredentials
    If rs.GetItemType(reportsTargetPath) = ItemTypeEnum.Folder Then
    rs.DeleteItem(reportsTargetPath)
    End If
    rs.CreateFolder(destinationFolder, "/", Nothing)
    Console.WriteLine("Parent folder {0} created successfully.", destinationFolder)
    CreateReportDataSource(datasourceName, "SQL", "Data Source=apopov\i2008;Initial Catalog=bdw")
    PublishReport("CRM Practice Report")
    PublishReport("CRM Report")
    PublishReport("Pipeline Practice Report")
    PublishReport("Pipeline Report")
    Console.WriteLine("Tasks completed successfully.")
    Catch ex As Exception
    Throw ex
    End Try
    End Sub
    Public Sub CreateReportDataSource(name As String, extension As String, connectionString As String)
    Dim definition As New DataSourceDefinition()
    definition.CredentialRetrieval = CredentialRetrievalEnum.Integrated
    definition.ConnectString = connectionString
    definition.Enabled = True
    definition.Extension = extension
    Try
    rs.CreateDataSource(name, reportsTargetPath, False, definition, Nothing)
    Catch e As Exception
    Console.WriteLine("ERROR creating data source: " + name)
    Throw e
    End Try
    End Sub
    Public Sub PublishReport(ByVal reportName As String)
    Try
    Console.WriteLine("Deploying report '{0}'", reportName)
    Dim stream As FileStream = File.OpenRead(reportsSourcePath + "\" + reportName + ".rdl")
    definition = New [Byte](stream.Length-1) {}
    stream.Read(definition, 0, CInt(stream.Length))
    stream.Close()
    rs.CreateReport(reportName, reportsTargetPath, False, definition, Nothing)
    Console.WriteLine("Report: {0} published successfully.", reportName)
    SetDatasource(reportName)
    Catch e As Exception
    Console.WriteLine("ERROR while Publishing report: " + reportName)
    Throw e
    End Try
    End Sub
    Public Sub SetDatasource(ByVal reportName As String)
    Try
    'Not working, I do not know why
    Console.WriteLine("Setting datasource to report '{0}'.", reportName)
    Dim reference As New DataSourceReference()
    reference.Reference = reportsTargetPath + "/" + datasourceName
    Dim source As New DataSource()
    source.Item = reference
    source.Name = datasourceName
    Dim sources As DataSource() = New DataSource(0) {}
    sources(0) = source
    rs.SetItemDataSources(reportsTargetPath + "/" + reportName, sources)
    Catch e As Exception
    Console.WriteLine("Error setting datasource to report '{0}'", reportName)
    Throw e
    End Try
    End Sub
    I have not ideans why this error may occures.

    Hi Alex,
    I have test the script in my test environment, it works.
    Based on the error message, the data source 'Warehouse Datasource' cannot be found. Please check, did you have add Warehouse Datasource.rds file in the same folder? In your case, it is located in: D:\Depot\Internal\BDW\BDW_Phase4\Src\BDW_R4.17.2\Reports\BDW_Reports
    If the issue is persist, please feel free to ask.
    Regards,
    Alisa Tang
    Alisa Tang
    TechNet Community Support

  • Need to restrict users from adding or modifying folders or reports

    Requirement: Need to restrict users from adding or modifying folders or reports through Info view and to reflect the modifications only thriough LCM.
    Issue: Customer wants to restrict users from adding or modifying existing reports from Infoview and need to force users to do make the changes through Life cycle manager tool.
    As per my understanding LCM can only be used to to promote folders and objects from one environment to another and to schedule the promotion of these jobs on a daily basis.My query is:
    Can we add or modify existing reports or folders using the LCM tool?
    Could you please help me out in this issue and provide me your suggestions.
    Thanks in advance.
    Prashanthi Rayaprolu.

    You can not restrict that using LCM. Need to modify the rights at the folder level.
    Explicitly remove the following rights for the user group,
    Add objects to the folder
    Edit objects
    Delete objects
    Copy objects to another folder (check this if required)
    Once the above four are denied then users wont be able to Edit/Add/Delete reports in that folder.

  • Read, Modify and Apply Report XML using Java Script

    Hi Guys,
    Is there any way that we can Pragmatically Read, Modify and Apply Report XML using Java Script or some other way.
    Thanks
    Kaushik
    Edited by: Kaushik K on Jun 20, 2012 8:36 PM

    Requirement ::
    Users should be able to add Column to the Report Dynamically at Runtime.
    (There are around 1000+ Users, Answers Approach is not acceptable)
    So we are planning to provide a Multi Select / Shuttle Box Option for Users to add Columns dynamically. (Only for Table View)
    What we planned to DO ::
    Create a Presentation Variable Prompt, Which reads the Metadata Table (Presentation Table.Column Name, populated using the Metadata Dictionary)
    And Create a report with One Column and the Column Fx like @{var_dynamic_columns}{'"Time"."Year","Time"."Month"'}
    With this, OBIEE is rewriting the Logical SQL Currently as "Select "Time"."Year","Time"."Month" from "A - Sample Sales" "
    But getting an error
    The number of columns returned in retrieving column metadata was invalid (expected: 1; received: 2)
    So we want to see, if we can rewrite the Advanced XML of the Report to have dynamic columns based on the Values from the Presentation Variable.
    Please help me if this is a viable solution or any other better solution.

  • Dynamically modify the crystal report field size based on Paper size in C#

    Hi,
    I need to modify the Crystal Report field size dynamically based on the paper size using C# .Net. According to the paper size, crytal report field width should be increase or decreae.
    Kindly suggest any solution on this.
    Thanks

    Moved to .NET SDK forum
    See these RAS samples:
    http://wiki.sdn.sap.com/wiki/display/BOBJ/NETRASSDK+Samples#NETRASSDKSamples-Exporting%2FPrinting
    Don

  • Error using Excel as a DataSource for Report Builder 3.0 - ODBC connection

    Hi,
    I'm getting this error message below while trying to use excel as a datasource within Report Builder 3.0.  I can see the columns and rows but unable to display/run the report.  Using Excel 32 bit and have the driver and user dsn created under c:/windows/syswow64/odbcad32.
    ERROR [IM002] [Microsoft][ODBC Driver Manager] Data source name not found and no default driver specified

    Hi Cherise,
    Vishal's link looks good.
    I have commercial experience in migrating Crystal Reports to SSRS. When performing any type of migration it is always wise for the business requirements to be revisited. It is likely that the business requirements may have changed since the Crystal reports
    were initially developed, etc.
    I've done some research for you and the following link looks quiet impressive and offers a cheap trial, in terms of a direct migration. Please tell me how you get on; - 
    http://www.sqlcircuit.com/2013/08/ssrs-how-to-create-report-using-excel.html
    I emphasis again I have commercial experience of lots of migration projects and it would be very unwise to not revisit the business requirements as part of the migration process.
    Kind Regards,
    Kieran.
    Kieran Patrick Wood http://www.innovativebusinessintelligence.com http://uk.linkedin.com/in/kieranpatrickwood http://kieranwood.wordpress.com/

  • Who modified the  standard report

    Hi,
      How can i find out who modified the  standard report in my server,guide me for the same.
    Thanku

    SE38 -> Enter report -> Mark Attributes -> Display  -> Last changed by.
    Regards
    Juan

  • I HAVE ENCOUNTERED A PROBLEM IN MODIFYING THE DEPARTMENTS REPORT

    I am a new learner database developer. I am now using Oracle 11g. Following the Developer tutorial on MODIFYING THE DEPARTMENTS REPORT I have encountered the following problem.
    Scroll down to Source, and replace the default Region Source script with the
    following:
    SELECT d.DEPARTMENT_ID,
    d.DEPARTMENT_NAME,
    (select count(*)from oehr_employees where department_id = d.department_id)
    "Number of Employees",
    substr(e.first_name,1,1)||'.'||e.last_name "Manager Name",
    c.COUNTRY_NAME "Location"
    FROM OEHR_DEPARTMENTS d,
    OEHR_EMPLOYEES e,
    OEHR_LOCATIONS l,
    OEHR_COUNTRIES c
    WHERE d.LOCATION_ID=l.LOCATION_ID
    AND l.COUNTRY_ID=c.COUNTRY_ID
    AND d.DEPARTMENT_ID=e.department_id
    AND d.manager_id=e.employee_id
    AND instr(upper(d.department_name),upper(nvl(:P2_REPORT_
    SEARCH,d.department_name)))>0
    6. Click Apply Changes.
    7. Click Apply Changes to confirm.
    8. Right-click Departments and select Edit Report Attributes.
    9. Click the Edit icon next to Number of Employees.
    10. Under Column Definition, select center for Column Alignment.
    11. Click Apply Changes.
    When I did it there was an error message as follows:
    ErrorRegion Source
    Query cannot be parsed, please check the syntax of your query. (ORA-00909: invalid number of arguments)+
    Unable to show report.
    Below is the syntax that was to be replaced:
    select
    "DEPARTMENT_ID",
    "DEPARTMENT_NAME",
    "MANAGER_ID",
    "LOCATION_ID"
    from "OEHR_DEPARTMENTS"
    Now; how should I correct it? I cannot move forward
    Regards
    DAVID GODIS-TEI
    Ghana

    In your post, the bind variable :P2_REPORT_SEARCH has a carriage return before the word SEARCH. Make sure this is not the case in the report.

  • Materials for modifying Oracle Standard Report

    Hi,
    I need to modify Oracle Standard Reports.
    Is their any material or documentation how to do it...?
    If some one could give me the link or documentation that would be really great full!
    Thank you!
    -Preetha.

    hi
    which type of modification u want explain me i will tel u soluation
    Rizwan

  • Problem pushing XML as DataSource to report

    Post Author: biiz
    CA Forum: JAVA
    Hello!
    I have a report which uses xml and xsd as datasource. I have now the requirement to dynamically set the xml-data into the report.
    I do this via reportClientDocument.getDatabaseController().setDataSource(xml_ds, "ObjectSpace", "") but I receive following exception although data in xml_ds is not null:
    Error occured: com.crystaldecisions.sdk.occa.report.lib.ReportSDKServerException: The data source object cannot be null.---- Error code:-2147024809 Error code name:failed
    The ReportClientDocument is retrieved from Crystal Report Server XI R2 .
    In crystalras log I have found following error-msg: ErrorLog 2008  5 29 10:56:40.784 1992 828 (\servers\ras\dtsagent\cdtsagent.cpp:3177): CDTSagent::doOneRequest reqId=272: CSResultException thrown.   ErrorSrc:"Analysis Server" FileName:"\servers\ras\dtsagent\reporthandler.cpp" LineNum:16948 ErrorCode:-2147024809 ErrorMsg:"The data source object cannot be null." DetailedErrorMsg:""
    Can you please help me?
    Regards,
    Gerald Spitzer
    Here is my code:
      CrystalEnterprise objCE = new CrystalEnterprise();  ISessionMgr objCESessionMgr = objCE.getSessionMgr();  objCESession = objCESessionMgr.logon("Administrator", "", this.getServletContext().getInitParameter("RAS"), "secEnterprise");  objTokenMgr = objCESession.getLogonTokenMgr();    cstrLogonToken = objTokenMgr.createLogonToken("", 60, 500);
       IInfoStore objInfoStore = (IInfoStore) objCESession.getService("InfoStore");
      java.lang.String cstrStatement;
      cstrStatement = "";  cstrStatement = cstrStatement + "SELECT SI_ID, SI_NAME";  cstrStatement = cstrStatement + "  FROM CI_INFOOBJECTS";  cstrStatement = cstrStatement + " WHERE SI_NAME = '" + reportName + "'";  cstrStatement = cstrStatement + "   AND SI_INSTANCE = 0";
      IInfoObjects objInfoObjects = objInfoStore.query(cstrStatement);
      if (objInfoObjects.getResultSize() > 0) {
       IInfoObject objInfoObject = (IInfoObject) objInfoObjects.get(0);
       IReportAppFactory objRASFactory = (IReportAppFactory) objCESession.getService("", "RASReportFactory");   ReportClientDocument objReport = (ReportClientDocument) objRASFactory.openDocument(objInfoObject,0,java.util.Locale.ENGLISH);
       FileInputStream fin = new FileInputStream("C:
    fragebogen_dokument_ohneADesc.xsd");   ByteArrayOutputStream baos = new ByteArrayOutputStream();   byte&#91;&#93; bytes = new byte&#91;1024&#93;;   for(;;) {    int count = fin.read(bytes);    if(count < 0)     break;    baos.write(bytes, 0, count);   }   final byte&#91;&#93; xsdBytes = baos.toByteArray();   fin.close();    fin = new FileInputStream("C:
    fragebogen_dokument_ohneADesc.xml");   baos = new ByteArrayOutputStream();   bytes = new byte&#91;1024&#93;;   for(;;) {    int count = fin.read(bytes);    if(count < 0)     break;    baos.write(bytes, 0, count);   }   final byte&#91;&#93; xmlBytes = baos.toByteArray();   fin.close();
       IXMLDataSet xml_ds = new IXMLDataSet() {    private IByteArray xmlData = null;    public void setXMLData(IByteArray xmlData) {     this.xmlData = xmlData;    }    public IByteArray getXMLData() {     return this.xmlData;    }    private IByteArray xmlSchema = null;    public void setXMLSchema(IByteArray xmlSchema){     this.xmlSchema = xmlSchema;    }    public IByteArray getXMLSchema() {     return this.xmlSchema;    }    };
       xml_ds.setXMLData(new IByteArray() {    public void fromString(String arrayValue){}    public String toString() { return ""; }    public byte&#91;&#93; getBytes() { return xmlBytes; }   });
       xml_ds.setXMLSchema(new IByteArray() {    public void fromString(String arrayValue){}    public String toString() { return ""; }    public byte&#91;&#93; getBytes() { return xsdBytes; }   });
       System.out.println("####bytes.length" + xml_ds.getXMLData().getBytes().length);
       objReport.getDatabaseController().setDataSource(xml_ds, "ObjectSpace", "");

    Post Author: Ted Ueda
    CA Forum: JAVA
    Below is sample RAS SDK XML datasource injection code.Sincerely,Ted Ueda<%@ page import = "com.crystaldecisions.sdk.exception.SDKException,                   com.crystaldecisions.sdk.framework.,                   com.crystaldecisions.sdk.occa.infostore.,                   com.crystaldecisions.sdk.occa.managedreports.,                   com.crystaldecisions.sdk.occa.report.application.,                   com.crystaldecisions.sdk.occa.report.data.,                   com.crystaldecisions.sdk.occa.report.definition.,                   com.crystaldecisions.sdk.occa.report.document.,                   com.crystaldecisions.sdk.occa.report.lib.,                   com.crystaldecisions.sdk.occa.report.exportoptions.,                   com.crystaldecisions.sdk.occa.report.reportsource.IReportSource,                   com.crystaldecisions.sdk.plugin.desktop.common.,                   java.io.,                   java.util."%><%/* * Environment variables - modify to suit your deployment  */String username = "";String password = "";String cmsname  = "<cms name here>";String authType = "secEnterprise";String reportName = "Test XML";   // Report name as published on EnterpriseString xmlFilePath = "C:
    XMLData
    new_test_data.xml";  // Path to XML datasource String xsdFilePath = "C:
    XMLData
    new_test_data.xsd";  // Path to XSD for XML datasource IEnterpriseSession boSession = null;try {    IInfoStore infoStore;    IInfoObjects infoObjs;    IInfoObject report;    IReportAppFactory raFactory;    ReportClientDocument doc;    byte&#91;&#93; xmlBytes;    byte&#91;&#93; xsdBytes;    IXMLDataSet xml_ds;    ByteArrayInputStream exportByteArrayStream;    byte&#91;&#93; exportByteArray;    boSession = CrystalEnterprise.getSessionMgr().logon(username, password, cmsname, authType);    infoStore = (IInfoStore)boSession.getService("", "InfoStore");    infoObjs = (IInfoObjects) infoStore.query("SELECT TOP 1 * FROM CI_INFOOBJECTS "                                               + "WHERE SI_KIND = 'CrystalReport' "                                              + " AND SI_INSTANCE=0 "                                              + " AND SI_NAME='" + reportName + "'" );    report = (IInfoObject) infoObjs.get(0);    raFactory  = (IReportAppFactory) boSession.getService("", "RASReportService");    doc = raFactory.openDocument(report, 0, Locale.ENGLISH);    xmlBytes = bytesFromFile(xmlFilePath);    xsdBytes = bytesFromFile(xsdFilePath);    xml_ds = new XMLDataSet(new ByteArray(xmlBytes), new ByteArray(xsdBytes));    doc.getDatabaseController().setDataSource(xml_ds, "schema1/People", "schema1/People");    exportByteArrayStream = (ByteArrayInputStream)doc.getPrintOutputController().export(ReportExportFormat.PDF);    exportByteArray = new byte&#91;exportByteArrayStream.available()&#93;;    response.reset();    response.setHeader("Content-disposition", "inline;filename=crreport.pdf");    response.setContentType("application/pdf");    int bytesRead = 0;    while((bytesRead = exportByteArrayStream.read(exportByteArray)) != -1) {        response.getOutputStream().write(exportByteArray, 0, bytesRead);        }            response.getOutputStream().flush();    response.getOutputStream().close();} finally {  if(boSession != null)       boSession.logoff();}%><%!byte&#91;&#93; bytesFromFile(String path) throws IOException {    FileInputStream fin;    ByteArrayOutputStream byteOStream = new ByteArrayOutputStream();    byte&#91;&#93; bytes;    fin = new FileInputStream(path);    bytes = new byte&#91;1024&#93;;    for(;;) {        int count = fin.read(bytes);        if(count < 0)            break;        byteOStream.write(bytes, 0, count);    }    bytes = byteOStream.toByteArray();    fin.close();    return bytes;}%>

  • Modifying a Crystal Report from a 3rd party

    We use a Enterprise software that has embedded crystal reports that you can run within the software.  However, we need to modify a few of these reports, add some fields and such.  Their reports folder has all of the .rpt files and I can open the files just fine.  However, to add any fields I have to create a connection to our instance of their database to add the fields.  The report will run fine in Crystal but once I try to run it through the enterprise software, the report dies out.
    How do I modify the report using our instance of the database but then save the new .rpt in such a way where it will use the DB connection information in the software?  Essentially I want a database agnostic .rpt file.
    I tried searching through the forums but I didn't see anything along these lines, but I may have not been using the right terminology during search.

    Thanks for the info and the report and confirming they are OK with you doing this....
    The report also uses a subreport against the tables directly. They both use an ODBC DSN using the MS SQL Server default SA account.
    So you need to create your DSN using the same log on info, User name is "sa" but Cr does not keep the password so you need to find that out. Once you get the ODBC System DSN created on your PC then you can add the fields as required and run the report to verify it all works.
    Next question you mentioned an Enterprise software to run the report. Is this Crystal Reports or BusinessObejcts Enterprise software or is that their program also? If it is ours then you can publish the report from Crystal Report Designer logging in as Administrator and then allow users to access it. Set the log on info for the report properties also and it all should work.
    If it's not BOE or CRE then you'll again have to ask them how to get these updated reprots into their Enterprsie software.
    Thank you
    Don

  • Error in setting datasource - Crystal reports

    Good day,
    I am currently experiencing a problem with setting my datasource to a report in Crystal Reports.
    Strangely, the report works in VS 2010, but when running as an executable, the program fails when assigning the datasource.
    My code:
        Public Sub PurchasesByVendor()
            Try
                Dim sql As String = "SELECT tblVendors.VendorID, tblVendors.VendorName, tblPO.POID, tblPO.EnterDate, tblCustomers.Company, tblOrders.RefNum, Sum(tblPOItems.ExtPrice) AS SumOfExtPrice " & _
                                    "FROM (((tblPO INNER JOIN tblPOItems ON tblPO.POID = tblPOItems.POID) INNER JOIN tblVendors ON tblPO.VendorID = tblVendors.VendorID) LEFT JOIN tblOrders ON tblPO.OrderID = tblOrders.OrderID) LEFT JOIN tblCustomers ON tblOrders.CustomerID = tblCustomers.CustomerID " & _
                                    "WHERE (((tblPO.EnterDate) Between #" & dpStart.Text & "# And #" & dpFinish.Text & "#)) " & _
                                    "GROUP BY tblVendors.VendorID, tblVendors.VendorName, tblPO.POID, tblPO.EnterDate, tblCustomers.Company, tblOrders.RefNum; "
                Dim con As New OleDb.OleDbConnection
                Dim da As OleDb.OleDbDataAdapter
                Dim ds As New DataSet
                con.ConnectionString = "PROVIDER=Microsoft.Jet.OLEDB.4.0;Data Source = C:\Program Files\Mail-Shop\MSApp2k.mdb"
                con.Open()
                da = New OleDb.OleDbDataAdapter(sql, con)
                da.Fill(ds, "PO")
                Dim povList As List(Of POV) = New List(Of POV)
                If ds.Tables("PO").Rows.Count > 0 Then
                    For i = 0 To ds.Tables("PO").Rows.Count - 1
                        Dim pov As POV = New POV()
                        pov.VendorName = ds.Tables("PO").Rows(i).Item(1)
                        pov.PONumber = ds.Tables("PO").Rows(i).Item(2)
                        pov.PODate = ds.Tables("PO").Rows(i).Item(3)
                        If IsDBNull(ds.Tables("PO").Rows(i).Item(4)) = False Then
                            pov.Company = ds.Tables("PO").Rows(i).Item(4)
                        End If
                        If IsDBNull(ds.Tables("PO").Rows(i).Item(5)) = False Then
                            pov.Order = ds.Tables("PO").Rows(i).Item(5)
                        End If
                        pov.Total = ds.Tables("PO").Rows(i).Item(6)
                        povList.Add(pov)
                    Next
                End If
                'MsgBox(povList.Count)
                Dim datas As POVD = New POVD()
                Dim dt As New DataTable("povd")
                'Dim dt As DataTable = datas.Tables.Add("hc")
                dt.Columns.Add("Vendor", GetType(String))
                dt.Columns.Add("PONumber", GetType(Integer))
                dt.Columns.Add("PODate", GetType(Date))
                dt.Columns.Add("Company", GetType(String))
                dt.Columns.Add("OrderNbr", GetType(Integer))
                dt.Columns.Add("Total", GetType(Double))
                dt.Columns.Add("Charged", GetType(Double))
                datas.Tables.Add(dt)
                For Each dr In povList
                    Dim vendor = dr.VendorName
                    Dim ponbr = dr.PONumber
                    Dim poDate As Date = DateValue(DateTime.Parse(dr.PODate))
                    Dim company = dr.Company
                    Dim order = dr.Order
                    Dim total = dr.Total
                    Dim charged = dr.getCharged(dr.PONumber)
                    Dim nw As DataRow = datas.Tables(0).NewRow()
                    nw(0) = vendor
                    nw(1) = ponbr
                    nw(2) = poDate
                    nw(3) = company
                    nw(4) = order
                    nw(5) = total
                    nw(6) = charged
                    datas.Tables(0).Rows.Add(nw)
                Next
                '' bind the datasource+
                Dim objRpt As New PurchaseByVendor
                objRpt.SetDataSource(datas.Tables(0))
                Dim wfp As New WindowFormReport()
                wfp.CrystalReportsViewer1.ViewerCore.ReportSource = objRpt
                Me.NavigationService.Navigate(wfp)
                con.Close()
                con.Dispose()
            Catch ex As Exception
                MsgBox(ex.Message)
            End Try
        End Sub
    Thanks!

    What version fo CR you are using, what service pack?
    What CR components are installed on the client machine for deployment?
    When using datasets to pass the data to Crystal reports, the issue occurs due to datasets in 50% of cases.
    What exact error do you get?
    Could you try below steps which would tell you if its an issue with Crystal or with getting data into datasets.
    - Once the data is populated in the dataset and before doing a "objRpt.SetDataSource(datas.Tables(0))", write the data to a datagrid.
    - While deploying the EXE, you could observe the datagrid to check fi the datasets do return some data.
    This may not be a Crystal issue.
    if you get the data in the datagrid and not in the report then do a 'ds.writeXml("XMLfilepath.xml")'. this will generate the XML file with the data from the dataset. the open the report indeaigner and try to assign the XMl to the report and see if the report works in thed esigner.
    - Bhushan
    Senior Engineer
    SAP Active Global Support
    Follow us on Twitter
    Got Enhancement ideas? Try the SAP Idea Place
    Getting started and moving ahead with Crystal Reports .NET applications.

  • To modify automatically a report column

    hi,
    I have created a report (standard report) with two columns "state" and "date_state".
    The column "state" is modified manually with the values 'elaboration' and 'pending', while I would want that the column "state" comes modified automatically to "date_state" = ' sysdate' when the value of "state" is = ' pending'.
    how I can make?
    thanks for your aid
    Luigi

    Luigi,
    Your question has been answered. Use a trigger (at the database level) or a process (at the application level). Either will work. Which one you choose depends on your circumstances.
    Here is an example of a trigger you might consider:
    create or replace trigger "MY_TABLE_BU"
    BEFORE
    update on "MY_TABLE"
    for each row
    begin
    if :new.state = 'pending' then
      :new.state_date := sysdate;
    end if;
    end;This is a very basic trigger that says something along the lines of: if I'm doing an update on a record in the table called MY_TABLE and the state column is being set to a value of 'pending' then before the record is committed, set the state_date column to todays date.
    Again, this is one way to accomplish what you want. Other options are available to suit your particular needs.
    Earl

  • Changing datasource of reports in a loop only works for first report.

    Hi,
    I have code that loops through a list of reports to change the datasource and save the change in the report. The idea is that this can be done at build time so time taken at runtime is only for opening the report and running it.
    The problem is that the first iteration of the loop works, and any further ones don't. Apart from closing the client document is there anything else that should be explicitly closed? I don't retrieve any ReportSource from the Client Document so I shouldn't need to dispose of that...I don't think. In particular is there something that should be done to the databaseController retrieved from the clientDoc after each loop?
    The code goes like the below:
    for(File report : reports){
         System.out.println("Preparing report: " + report.getAbsolutePath());
         ReportClientDocument clientDoc = CRJavaHelper.getReportClientDocument(
                   report.getAbsolutePath());
         CRJavaHelper.replaceDBConnection(clientDoc, props);
         clientDoc.close();
         System.out.println("Report " + report.getAbsolutePath() + " prepared.");
    getReportClientDocument does this:
    ReportClientDocument clientDoc = new ReportClientDocument();
    clientDoc.setReportAppServer("inproc:jrc");
    clientDoc.open(fullPath,
              OpenReportOptions.openAsReadOnly.value());
    return clientDoc;
    replaceDBConnection does the following:
    DatabaseController dc = clientDoc.getDatabaseController();
    logonDataSource(dc, username, password);
    prepareReport(dc, schema);
    ConnectionInfos cis = dc.getConnectionInfos(null);
    for (IConnectionInfo oldci : cis) {
         IConnectionInfo newci = new ConnectionInfo();
         newci.setKind(ConnectionInfoKind.SQL);
         newci.setAttributes(propBag);
         newci.setUserName(username);
         newci.setPassword(password);
         dc.replaceConnection(oldci, newci, null, DBOptions._useDefault
                   + DBOptions._doNotVerifyDB);
    SubreportController src = clientDoc.getSubreportController();
    IStrings strs = src.getSubreportNames();
    Iterator<?> it = strs.iterator();
    while (it.hasNext()) {
            String name = (String) it.next();
         ISubreportClientDocument subreport = src.getSubreport(name);
         DatabaseController sdc = subreport.getDatabaseController();
         cis = sdc.getConnectionInfos(null);
         for (IConnectionInfo oldci : cis) {
              IConnectionInfo newci = new ConnectionInfo();
              newci.setAttributes(new PropertyBag(propBag));
              newci.setUserName(username);
              newci.setPassword(password);
              sdc.replaceConnection(oldci, newci, null, DBOptions._useDefault
                        + DBOptions._doNotVerifyDB);
    clientDoc.save();

    What's the URL for the site where you are using this?  Offhand, it looks like it should work with your first example so you are either placing the script before those elements are loaded or you might try wrapping your current javascript inside the:
    $(document).ready(function() {
    --- your existing javascript here
    This make sure the code runs once all the html is loaded on the page.  Without seeing a URL and debugging with the js console in Chrome I can't give you a solid answer.
    But, I do know that you can probably do this with a lot less markup.  Once we figure out what the actual problem is I have a better solution mocked up for you on jsfiddle.
    When looking at my HTML code on jsfiddle, please realize I setup some dummy HTML and removed your tags and added actual values which would be output by your tags.  The main thing I did was remove the whole div.more-selection and instead, added a "data-is-selected" attribute on your div.more-option element.  Then, in my javascript for each div.my-option element on the page, we loop through them, find the value of that data attribute and hide that div if it's less than 1 (or 0).
    Here's the fiddle for you to look at:  http://jsfiddle.net/thetrickster/Mfmdu/
    You'll see in the end result that only two divs show up, both of those divs have data-is-selected="1".
    You can try pasting the javascript code near the closing </body> tag on your page and make sure to wrap my js inside a <script> tag, obviously.  My way is neater on the markup side.  If you can't get it to work it's likely a jquery conflict issue.  My version is using the $(document).ready() method to make sure all the code is loaded before it runs.
    Best,
    Chris

Maybe you are looking for

  • How to use Property Editor from an Add-In?

    Hi, I am writing a WYSIWYG add-in for JDev that allows users to put some object into a JPanel instance. Thess object has properties such as left, right, width, height, etc. - Question: how to use JDev's property editor to allow users change propertie

  • Money taken from my account I don't know why

    Hi, I am student and I bought the photoshop license about a week ago and One day after I bought it I realised you had a better offer so a switched to that offer, I asked spoke with one of your colleagues, Lyna, who told me that I wouldn't be charge f

  • How can I unlock my old iPod?

    My iPod touch is disabled, and I ant remember my old appleID. How can I get into the iPod.

  • Why tata docomo cdma (india) sim is not working with my iPhone 5 A1429 Hong-Kong model?

    I have bought second hand iPhone 5 Hong kong model A1429 and it works with all gsm carriers can i use cdma sim in it? i have iOS 8.1 and i searched through internet and i found that A1429 model supports worldwide GSM and CDMA networks but actually it

  • Errros in formatting dates with milliseconds

    I am writing a routine to convert a String to a Date. I have created the following mask: "yyyy-MM-dd HH:mm:ss.SSSSS" I pass this to SimpleDateFormat and then parse to return a java.util.Date. The method works fine when the milliseconds are all zero,