Skip to Content
author's profile photo Former Member
Former Member

is that any way to add dynamic image in Crystalreport 11 xi release 2 ?

My code is :

ReportDocument reportDocument = new ReportDocument();

CrystalDecisions.Windows.Forms.CrystalReportViewer crystalReportViewer1 = new CrystalDecisions.Windows.Forms.CrystalReportViewer();

TableLogOnInfos crtableLogoninfos = new TableLogOnInfos();

TableLogOnInfo crtableLogoninfo = new TableLogOnInfo();

ConnectionInfo crConnectionInfo = new ConnectionInfo();

Tables CrTables;

// load report

reportDocument.Load(AppDomain.CurrentDomain.BaseDirectory.ToString() + "\\Reports\\" + reportName);

// set report Parameter

if (Param_Values != null)

{

foreach (KeyValuePair<string, object> Param_Value in Param_Values)

{

reportDocument.SetParameterValue(Param_Value.Key, Param_Value.Value);

}

}

// set report Connection info

string[] LoginData = PerfectPos.Properties.Settings.Default.ConnectionString.Split(';');

if (!string.IsNullOrEmpty(LoginData[4].ToString()))

{

crConnectionInfo.Password = LoginData[4].Split('=')[1].ToString();

}

crConnectionInfo.UserID = LoginData[3].Split('=')[1].ToString();

crConnectionInfo.DatabaseName = LoginData[1].Split('=')[1];

crConnectionInfo.ServerName = LoginData[0].Split('=')[1];

CrTables = reportDocument.Database.Tables;

foreach (CrystalDecisions.CrystalReports.Engine.Table CrTable in CrTables)

{

crtableLogoninfo = CrTable.LogOnInfo;

crtableLogoninfo.ConnectionInfo = crConnectionInfo;

CrTable.ApplyLogOnInfo(crtableLogoninfo);

}

crystalReportViewer1.ReportSource = reportDocument;

crystalReportViewer1.Refresh();

WindowsFormsHost host = new WindowsFormsHost();

host.Child = crystalReportViewer1;

grd_layout.Children.Add(host);

the problem is :

my viewer and Reportdocument take the parameter successfully but when the viewer show my report the image show the default image not the passed image path

Add a comment
10|10000 characters needed characters exceeded

Related questions

3 Answers

  • Best Answer
    author's profile photo Former Member
    Former Member
    Posted on Sep 19, 2013 at 10:32 AM

    it works fine when i upgradefrom CRruntime2008 to CRruntime2013.msi

    Add a comment
    10|10000 characters needed characters exceeded

  • Posted on Sep 18, 2013 at 02:44 PM

    Need more of an explanation on this:

    my viewer and Reportdocument take the parameter successfully but when the viewer show my report the image show the default image not the passed image path

    By image, you mean that you are not getting refreshed data from the database?

    If that is the case, ensure the report does not have "saved data" enabled.

    - Ludek

    Senior Support Engineer AGS Product Support, Global Support Center Canada

    Follow us on Twitter

    Got Enhancement ideas? Try the SAP Idea Place

    Share Your Knowledge in SCN Topic Spaces

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Sep 19, 2013 at 10:32 AM

    thanks for all replies

    Add a comment
    10|10000 characters needed characters exceeded

Before answering

You should only submit an answer when you are proposing a solution to the poster's problem. If you want the poster to clarify the question or provide more information, please leave a comment instead, requesting additional details. When answering, please include specifics, such as step-by-step instructions, context for the solution, and links to useful resources. Also, please make sure that you answer complies with our Rules of Engagement.
You must be Logged in to submit an answer.

Up to 10 attachments (including images) can be used with a maximum of 1.0 MB each and 10.5 MB total.