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 7847037
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 2, 20262026-06-02T17:46:26+00:00 2026-06-02T17:46:26+00:00

im using the Crystal Reports VCL for Delphi 7 to run Crystal Reports from

  • 0

im using the Crystal Reports VCL for Delphi 7 to run Crystal Reports from Delphi. I want to set current parameter values from this Delphi application. I’m sending succesfully this values for Number or String Parameters. But now i’m struggling with Date Parameters that have set Allow Ranges to True.

The Error im getting is: 305:Error converting string to ValueInfo - ParamFields[2].CurrentValues.Add <StrToValueInfo>

I’m using this code which like i said works for no Range Parameters. In the code below the parameter PARAM_DATE is a Date parameter which allows Ranges. Any idea how to pass range values?

procedure TReportFrame.btnExecuteReportClick(Sender: TObject);
var
    Crpe1 : TCrpe;
    varArr : variant;
    i : integer;
    a : TCrpeParamFieldRangesItem;
    b : TCrpeParamFieldCurrentValuesItem;
begin
  SetCurrentDir( GetCommonFilesPath );
  try
  Crpe1 := TCrpe.Create(Self);
  Crpe1.DiscardSavedData();
  Crpe1.ReportName := getReportBasePath() + reportFileName;

  Crpe1.IgnoreKnownProblems := true;
  Crpe1.LoadEngineOnUse := true;
  Crpe1.Connect.Clear;

  Crpe1.Tables[0].ConnectBuffer := glbDBMan.GetConnectionString;

    Crpe1.ParamByName('PARAM_SORTING_TYPE', EmptyStr).CurrentValue :=  VarToStr( paramSposobSortowania.getSelectedValue());

  varArr := parameterOsobaOdpowiedzialna.getSelectedValues();
  for i := VarArrayLowBound(varArr,1) to VarArrayHighBound(varArr,1) do
  begin
    Crpe1.ParamByName('PARAM_PERSON', EmptyStr).CurrentValues.Add(VarToStr( varArr[i]));
  end;

//  Crpe1.ParamByName('PARAM_DATA_ZLOZENIA_WNIOSKU', EmptyStr).CurrentValues.Add('2012-4-1');
//  a := TCrpeParamFieldRangesItem.Create;
//  a.RangeStart := '2012-4-1';
//  a.RangeEnd := '2012-4-6';
//  Crpe1.ParamByName('PARAM_DATE', EmptyStr).Ranges.Add();
//  Crpe1.ParamByName('PARAM_DATE', EmptyStr).Ranges[0].RangeStart := '2012-4-1';
//  Crpe1.ParamByName('PARAM_DATE', EmptyStr).Ranges[0].RangeEnd := '2012-4-6';

//  Crpe1.ParamByName('PARAM_DATE', EmptyStr).CurrentValues.Add('2012-4-1');

    //PARAM_DATE is a DATE Range
  Crpe1.ParamByName('PARAM_DATE', EmptyStr).CurrentValues.Add('2012-4-1');
  Crpe1.ParamByName('PARAM_DATE', EmptyStr).CurrentValues.Add('2012-4-6');

  if Crpe1.Connect.Test then
    Crpe1.Show
  else
    ShowMessage('Error Connecting');

    Crpe1.DiscardSavedData;

    finally
      SetCurrentDir( ExtractFileDir(ParamStr(0)) );
    end;
end;
  • 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-06-02T17:46:28+00:00Added an answer on June 2, 2026 at 5:46 pm
    Crpe1.ParamByName('PARAM_DATE', EmptyStr).Ranges.Add();
    Crpe1.ParamByName('PARAM_DATE', EmptyStr).Ranges[0].RangeStart := '2012,4,1';
    Crpe1.ParamByName('PARAM_DATE', EmptyStr).Ranges[0].RangeEnd := '2012,4,6';
    

    UPDATE: there is a function in the VCL (file: UCrpeUtl) called CrDateToStr which takes a TDateTime and returns this format of a date string.

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

Sidebar

Related Questions

I want to create a report, using either Crystal reports or RDLC, doesn't really
I have some reports developed using Crystal Reports 12 and I want to version
I need to print PDF's generated in an asp.net application using crystal reports. Upon
I am using crystal reports in visual studio 2005 to generate invoices. I want
I'm using Crystal Reports in my asp.net application. I need to pass string as
My company has a VB6 application using Crystal Reports 7 which a client has
I am using Crystal Reports with C# programming language. I want to open another
I'm using Crystal Reports in Visual Studio 2003 and i want to automatically change
I am trying to upgrade my code from using Crystal Reports 11 to Crystal
I have created reports using Crystal Reports in my asp.net application(vb). It was fine.

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.