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

  • SEARCH
  • Home
  • 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 6975513
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T17:22:41+00:00 2026-05-27T17:22:41+00:00

I have an error when passing my TextBox value to my Crystal Report: System.Runtime.InteropServices.COMException(0x8002000B):

  • 0

I have an error when passing my TextBox value to my Crystal Report:

System.Runtime.InteropServices.COMException(0x8002000B): Invalid index. (Exception from HRESULT: 0x8002000B(DIS_E_BADINDEX))
at CrystalDecisions.ReportAppServer.DataDefModel.FieldsClass.get_Item(Int32 Index)
at CrystalDecisions.CrystalReports.Engine.ParameterFieldDefinitions.get_Item(Int32 Index)
at CrystalDecisions.CrystalReports.Engine.ParameterFieldDefinitions.get_Item(String  fieldName)
at WindowsFormsApplication1.Form15.button1_Click(Object sender, EventArgs e) in ..\Form15.cs: line 134

this is my code for getting my entered values in my textboxes to be shown in the report including the error line:

  ParameterFieldDefinitions paramFieldDefinitions;
  paramValue = new ParameterValues();
  discreteValue = new ParameterDiscreteValue();

  discreteValue.Value = Convert.ToString(txtYear.Text);
  paramFieldDefinitions = CrystalReport81.DataDefinition.ParameterFields;
  fieldDefinition = paramFieldDefinitions["Year"]; <-- the is the line 134
  commonParam();

  discreteValue.Value = Convert.ToString(comMonth.Text);
  paramFieldDefinitions = CrystalReport81.DataDefinition.ParameterFields;
  fieldDefinition = paramFieldDefinitions["Month"];
  commonParam();

  discreteValue.Value = Convert.ToString(Grade);
  paramFieldDefinitions = CrystalReport81.DataDefinition.ParameterFields;
  fieldDefinition = paramFieldDefinitions["Grade"];
  commonParam();

  discreteValue.Value = Convert.ToString(date);
  paramFieldDefinitions = CrystalReport81.DataDefinition.ParameterFields;
  fieldDefinition = paramFieldDefinitions["date"];
  commonParam();

The codes below are for passing parameters to stored procedure: (This is running)

  ParameterFields myParams = new ParameterFields();

  ParameterField name = new ParameterField();
  ParameterDiscreteValue valName = new ParameterDiscreteValue();
  name.ParameterFieldName = "@Log_User";
  valName.Value = comEmployee.Text;
  name.CurrentValues.Add(valName);
  myParams.Add(name);

  ParameterField month = new ParameterField();
  ParameterDiscreteValue valMonth = new ParameterDiscreteValue();
  month.ParameterFieldName = "@Month";
  valMonth.Value = Convert.ToInt32(iMonth);
  month.CurrentValues.Add(valMonth);
  myParams.Add(month);

  ParameterField year = new ParameterField();
  ParameterDiscreteValue valYear = new ParameterDiscreteValue();
  year.ParameterFieldName = "@Year";
  valYear.Value = Convert.ToInt32(txtYear.Text);
  year.CurrentValues.Add(valYear);
  myParams.Add(year);

  crystalReportViewer1.ParameterFieldInfo = myParams;
  crystalReportViewer1.ReportSource = CrystalReport81;
  crystalReportViewer1.Refresh();

I really do not know how to add the values from my textboxes to my Crystal Report.. Please help me to do it…

Thank you and God bless 😀

  • 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-27T17:22:41+00:00Added an answer on May 27, 2026 at 5:22 pm
    TextObject yr =  (TextObject)CrystalReport81.ReportDefinition.Sections["Section3"].ReportObjects["Text1"];
                yr.Text = txtYear.Text;
    

    FORM Textbox –> CRYSTAL REPORT Textbox

    By adding the code above will enable you to show the value you entered in the textboxes.. but first you should have an empty Textbox in your Crystal Report because that will catch the value you throw from your FORM Textbox

    I hope it can help others.. as it helped me a lot..

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have tried to use the following code to passing value back from the
I have two project and having trouble on passing value between two project. As
We have an error that we can't seem to find and don't have the
I have an error handling method in my ApplicationController: rescue_from ActiveRecord::RecordNotFound, :with => :not_found
I have an error occuring frequently from our community server installation whenever the googlesitemap.ashx
I have this error message: Msg 8134, Level 16, State 1, Line 1 Divide
I have this error that is keeping me from moving forward. I basically have
You have an error in your SQL syntax; check the manual that corresponds to
I have an error during compiling: raja@raja-desktop:~/socket$ g++ Socket.cpp Socket.cpp: In member function ‘int
This time I have an error which I have been trying again to figure

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.