Skip to Content

How to get Date format and Date Order?

Dear Experts,

below code i can get the left,top,etc.. but i want to get Date Field format

ReportObject ReportObject = rpt.ReportDefinition.ReportObjects[i];

FieldObject FieldObject = (FieldObject)ReportObject;

int Left = FieldObject.Left;

int top = FieldObject.Top;

string name = FieldObject.Name;

like i wants to get Date Order (DMY,MDY,YMD)....

if i get this i generate to XML after that i inserted into DB.

once i inserted into DB, again i read from DB dynamically assigned to Report.

as like,

FieldObject.Left = dr("LEFT")

FieldObject.Top = dr("TOP")

is this possible to reassign the date format to Report?

please help to get this...

thanks in advance


Add a comment
10|10000 characters needed characters exceeded

Related questions

1 Answer

  • Best Answer
    Posted on Dec 27, 2013 at 03:50 PM

    Hi Mani,

    Do you mean date format and not date order? Data order to me means you want to sort the date field ascending or descending... It's the location date format you want correct?

    Run in debug mode and you'll see the field type:

    btnReportObjects.Text = "";

    flcnt = 0;

    CrystalDecisions.ReportAppServer.ReportDefModel.ReportObjects rptObjs;

    //rptObjs = rptClientDoc.ReportDefController.ReportObjectController.GetReportObjectsByKind(CrReportObjectKindEnum.crReportObjectKindField);

    rptObjs = rptClientDoc.ReportDefController.ReportObjectController.GetAllReportObjects();

    foreach (CrystalDecisions.ReportAppServer.ReportDefModel.ReportObject rptObj1 in rptObjs)


    switch (rptObj1.Kind)


    case CrReportObjectKindEnum.crReportObjectKindField:

    CrystalDecisions.ReportAppServer.ReportDefModel.FieldObject fldObj1;

    fldObj1 = (CrystalDecisions.ReportAppServer.ReportDefModel.FieldObject)rptObj1;

    textBox1 = fldObj1.Name.ToString();

    textBox1 += " -> ";

    textBox1 += fldObj1.DataSourceName.ToString();

    btnReportObjects.Text += textBox1;



    btnCount.Text = flcnt.ToString();



    FieldValueType = 15 means it's a Dateformat:

    Not enough info to say how to do all of this from you but this should give you enough info to get.

    From above you should be able to figure out what it is you want...


    pastedImage_0.png (48.9 kB)
    pastedImage_1.png (25.7 kB)
    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.