Trying to add ParagraphFieldElement

Hi all.
I'm trying to add TextObject with ParagraphFieldElement to the report wia RAS SDK:
ParagraphFieldElement boParagraphFieldElement = new ParagraphFieldElement();
boParagraphFieldElement.setDataSource("GroupName ({Student.Course})");
boParagraphElements.add(boParagraphFieldElement);
...but when i call refreshReportDocument(); throws exception:
com.crystaldecisions.sdk.occa.report.lib.ReportSDKServerException: ---- Error code:-2147467259 Error code name:failed
it is true to add the object?
Edited by: tas.nix on Mar 20, 2011 10:27 PM
Edited by: tas.nix on Mar 20, 2011 10:28 PM

If you want to add a simpel text field to the report, look at the attached code snippet:
ISection sectionToAddTo = oReportClientDocument.getReportDefController().getReportDefinition().getDetailArea().getSections().getSection(0);
     // Create the text object
     TextObject oTextObject = new TextObject();
     // Create the paragraph elements for the text Object     
     Paragraphs oParagraphs = new Paragraphs();
     Paragraph oParagraph = new Paragraph();
     ParagraphElements oParagraphElements = new ParagraphElements();
     ParagraphTextElement oParagraphTextElement = new ParagraphTextElement();
     // Set the text value for the text field
     oParagraphTextElement.setText("This is a text field");
     oParagraphTextElement.setKind(ParagraphElementKind.text);
     // fix some wierd defaults and behavior by explicitly setting default font
     FontColor newFontColor = new FontColor();
     Font newfont = new Font();
     newfont.setBold(false);
     newfont.setName("Arial");
     newFontColor.setIFont(newfont);
     oParagraphTextElement.setFontColor(newFontColor);
     oParagraphElements.add(oParagraphTextElement);
     oParagraph.setParagraphElements(oParagraphElements);
     oParagraphs.add(oParagraph);
     oTextObject.setParagraphs(oParagraphs);
     // Now add it to the section
     oTextObject.setLeft(8000);
     oTextObject.setTop(1);
     oTextObject.setWidth(1911);
     oTextObject.setHeight(226);
     oReportClientDocument.getReportDefController().getReportObjectController().add(oTextObject, sectionToAddTo, -1);

Similar Messages

Maybe you are looking for

  • How to display a time greater than 24hrs?

    Hi all I am trying to create a wages tracker by entering start and finishing times for each day, working out the time worked and then adding it all together to get a weekly value. This works fine and if I have 5 days at 9hrs it correctly gives me 45h

  • X200 Fan Issues with Windows 7

    Hi all, I've just done a fresh install of Windows 7 Ultimate 64-bit onto my X200, and everything works great except for 1 thing - the fan constantly runs and doesn't stop at all as long as the laptop is on. I've seen a few other posts of other X200 o

  • Dataprovider loose mapping to queries and infoprovider after transport

    Hi Experts, I have collected all relevant query elements and work sheets and transported them into productive BI system. When executing the work sheets in BEx Analyzer, they simply don't work due to lack of variables. When I changed to design mode, I

  • How to upload a file into specified location

    Hi Frndz.. How to upload a file using File upload feature in web dynpro into our specified location(usr/sap/Images/....),not into  workspace r default path in server. Thanks in Advance Regards Rajesh

  • Does playing my ipod on the car stereo with USB hurt the battery of the ipod?

    Just curious if when playing the ipod on the car stereo using the usb plugged into the stereo unit will cause the battery life to shorten since it is seems to be charging the ipod.  Or does the ipod have a regulator that stops the charging once the b