Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 3404102
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 18, 20262026-05-18T05:20:30+00:00 2026-05-18T05:20:30+00:00

I have a Crystal Reports report and I want to edit a label programmatically

  • 0

I have a Crystal Reports report and I want to edit a label programmatically from c#. I can manipulate data source but cannot edit a label.

I’m designing a bill report so I need to display company details, date time and some other information which I can’t get from my data source.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-18T05:20:30+00:00Added an answer on May 18, 2026 at 5:20 am

    Normally for a bill, where the company name and details of it (like address etc) are shown at the top of the bill. In such a case, what I use is the report header. In that case, you can pass on the text to be shown very easily. The other way of passing on something at runtime will be using report parameter. You can bind the parameter to a field or to a formula. Parameters are also very easy to pass on.

    In one occasion, I have used the following code to get the parameters from a report dynamically and bind it to a gridview:

        private void GetParameters()
        {
            //DataTable dt = new DataTable("Params");
            string dataTableName  = "Params";
            //add a tablestyle to the grid so there will be custom columnstyles available
            // after the datasource has been set....
            DataGridTableStyle ts = new System.Windows.Forms.DataGridTableStyle();
            ts.MappingName = dataTableName;
            dtgParams.TableStyles.Add(ts);
    
            // DataGridTextBoxColumn
            DataGridTextBoxColumn cParamName = new DataGridTextBoxColumn();
            cParamName.MappingName = "Parameter";
            cParamName.HeaderText = "Parameter";
            cParamName.ReadOnly=true;
    
            // Add the column style to the column style collection
            ts.GridColumnStyles.Add( cParamName );
    
            // DataGridTextBoxColumn
            DataGridTextBoxColumn cType = new DataGridTextBoxColumn();
            cType.MappingName = "Data_Type";
            cType.HeaderText = "Data Type";
            cType.ReadOnly=true;
    
            // Add the column style to the column style collection
            ts.GridColumnStyles.Add( cType );
    
            // DataGridTextBoxColumn
            DataGridTextBoxColumn cValue = new DataGridTextBoxColumn();
            cValue.MappingName = "Value";
            cValue.HeaderText = "Value";
            cValue.ReadOnly=false;
    
            // Add the column style to the column style collection
            ts.GridColumnStyles.Add( cValue );
    
            DataRow dr;
            dt.Columns.Add(new DataColumn("Parameter",typeof(string)));
            dt.Columns.Add(new DataColumn("Data_Type",typeof(string)));
            dt.Columns.Add(new DataColumn("Value",typeof(string)));
    
            // For all the Parameters defined in the report
            for(int i=0;i<ReportDoc.DataDefinition.ParameterFields.Count;  i++)
            {
                dr = dt.NewRow();
                dr[0] = ReportDoc.DataDefinition.ParameterFields[i].ParameterFieldName;
                dr[1] = ReportDoc.DataDefinition.ParameterFields[i].ParameterValueKind;
                dr[2] = ReportDoc.DataDefinition.ParameterFields[i].DefaultValues[0];
                dt.Rows.Add(dr);
            }
            DataView source = new DataView(dt);
            dtgParams.DataSource = source;
        }
    

    And used the following code segment to set parameters:

        private void SetParamValue  (string paramName, string paramValue)
        {
            ParameterFieldDefinition PFD = null;
            ParameterValues PValues = null;
            ParameterDiscreteValue Parm = null;
            PValues = new ParameterValues();
            PFD = ReportDoc.DataDefinition.ParameterFields[paramName];
            Parm = new ParameterDiscreteValue();
            Parm.Value = paramValue;
            PValues.Add(Parm);
            PFD.ApplyCurrentValues(PValues);
        }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I want to automate CR report printing from VB/VBA. I have Crystal Reports XI
I am using Crystal Report 2008 with C# , have a WinForm and want
I have a report that I created with Crystal Reports 2008. This report uses
In VS 2008, I have a crystal main report with about 20 sub reports.
I have a crystal report file I need make a tiny edit in. It
I have a Crystal Report in Visual Studio 2010 and I want to select
I have some reports developed using Crystal Reports 12 and I want to version
I have a crystal report which has a running total field, i want to
I have a multicolumn crystal reports, Now i want to display running total for
Often I'm creating reports in Visual Studio's Crystal Reports and want to have a

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.