Help needed - trying to programatically change a report

I want to write a VB program that can open a crystal 2008 report, change the size of 1 field, add a text box, and save the report.
I can open the report, change a field size, and save it, but I don't know how to add an object.
There is no add method for the reportobjects collection.
Any hints / ideas / sample code?
Thanks

You will need to be using CR XI R2 SP2 or later so that you can use inproc RAS to do this.
           using CrystalDecisions.CrystalReports.Engine;
           using CrystalDecisions.ReportAppServer.ClientDoc;
            //CR Declarations
            ReportDocument                                                                                m_boReportDocument;
            ISCDReportClientDocument                                                                                m_boReportClientDocument;
           CrystalDecisions.ReportAppServer.ReportDefModel.ReportObject                        m_boReportObject;
           CrystalDecisions.ReportAppServer.ReportDefModel.ReportObject                        m_boReportObjectModified;
           CrystalDecisions.ReportAppServer.ReportDefModel.Section                                m_boSection;
           CrystalDecisions.ReportAppServer.ReportDefModel.TextObject                           m_boTextObject;
           CrystalDecisions.ReportAppServer.ReportDefModel.Paragraphs                          m_boParagraphs;
           CrystalDecisions.ReportAppServer.ReportDefModel.Paragraph                            m_boParagraph;
           CrystalDecisions.ReportAppServer.ReportDefModel.ParagraphElements           m_boParagraphElements;
           CrystalDecisions.ReportAppServer.ReportDefModel.ParagraphTextElement      m_boParagraphTextElement;
           CrystalDecisions.ReportAppServer.ReportDefModel.FontColor                             m_boFontColor;
           CrystalDecisions.ReportAppServer.ReportDefModel.Font                                      m_boFont;
            //create a new ReportDocument
            m_boReportDocument = new ReportDocument();
            //load the RPT file
            m_boReportDocument.Load("..
DummyReport.rpt");
            //access the ReportClientDocument in the ReportDocument (EROM bridge)
            m_boReportClientDocument = m_boReportDocument.ReportClientDocument;
            //first determine which area and section to add the text field to - in this case the ReportHeaderArea first's section
            m_boSection = m_boReportClientDocument.ReportDefController.ReportDefinition.ReportHeaderArea.Sections[0];
            //create the textobject
            m_boTextObject = new CrystalDecisions.ReportAppServer.ReportDefModel.TextObject();
            //create the paragraph elements for the textobject
            m_boParagraphs = new CrystalDecisions.ReportAppServer.ReportDefModel.Paragraphs();
            m_boParagraph = new CrystalDecisions.ReportAppServer.ReportDefModel.Paragraph();
            m_boParagraphElements = new CrystalDecisions.ReportAppServer.ReportDefModel.ParagraphElements();
            m_boParagraphTextElement = new CrystalDecisions.ReportAppServer.ReportDefModel.ParagraphTextElement();
            //set the text value for the text field
            m_boParagraphTextElement.Text = "This is the added text field in the reportheader";
            m_boParagraphTextElement.Kind = CrystalDecisions.ReportAppServer.ReportDefModel.CrParagraphElementKindEnum.crParagraphElementKindText;
            //fix some wierd defaults and behavior by explicitly setting default font
            m_boFontColor = new CrystalDecisions.ReportAppServer.ReportDefModel.FontColor();
            m_boFont = new CrystalDecisions.ReportAppServer.ReportDefModel.Font();
            m_boFont.Bold = true;
            m_boFont.Name = "Arial";
            m_boFontColor.Font = m_boFont;
            m_boParagraphTextElement.FontColor = m_boFontColor;
            m_boParagraphElements.Add(m_boParagraphTextElement);
            m_boParagraph.ParagraphElements = m_boParagraphElements;
            m_boParagraphs.Add(m_boParagraph);
            m_boTextObject.Paragraphs = m_boParagraphs;
            //now add it to the section
            m_boTextObject.Left = 2000;
            m_boTextObject.Top = 1;
            m_boTextObject.Width = 5000;
            m_boTextObject.Height = 226;
            m_boReportClientDocument.ReportDefController.ReportObjectController.Add(m_boTextObject, m_boSection, -1);
            //display in reportviewer
            crystalReportViewer1.ReportSource = m_boReportDocument;
Jason

Similar Messages

  • Help Needed in passing parameter to cryst report

    Hello everyone, I am trying to create a report for a single record and as such am trying to pass parameters to a crystal report but I am not sure exactly how to do this. This is my own method that I am employeeing. I do not want to create a data table and put all the info I need in there and then base a report off of it. I do not want to deal with loops and arrays right now. I just want to pass for example parameter JuvenileID = 1 to my crystal report, then create a command under the database expert and set the parameter for my command to the parameter I passed my crystal report. How would I go about in doing this? I am using VS 2010 C#. This is a windows application. I have a dataentry form that is already populated with the info needed for the report. I just need to pass all the controls.text values to the report and populate it that way.

    I'm not sure if I fully understand the issue, but since you have all the data you need in a data entry form that is already populated, why don't you simple create an ADO .NET Dataset and pass that to the report? Much easier to implement, faster execution with the small amount of data you have and less code.
    Dataset sample app is here:
    https://wiki.sdn.sap.com/wiki/display/BOBJ/CrystalReportsfor.NETSDK+Samples
    More info on datasets is here:
    [1511438 - How to use datasets to pass data to crystal reports|http://www.sdn.sap.com/irj/servlet/prt/portal/prtroot/com.sap.km.cm.docs/oss_notes_boj/sdn_oss_boj_bi/sap(bD1lbiZjPTAwMQ==)/bc/bsp/spn/scn_bosap/notes%7B6163636573733d36393736354636443646363436353344333933393338323636393736354637333631373036453646373436353733354636453735364436323635373233443330333033303331333533313331333433333338%7D.do].
    - Ludek

  • HT5621 Help needed for I Cloud change of Apple ID

    I have recently changed my mailadress and therefore changed my Apple ID to the new mail adress. But the I Cloud is still associatet with the old mail for the Apple ID and i can not log out and change the old Apple ID to the new. I have tryed to delete the old I cloud account (i have not used it yet) and make a new with the changed Apple ID, but i have to log out/delete with the old Apple ID but it is not valid any more because of the changed mailadress!!
    Help please.
    Best. Thomas (Denmark)

    You have to sign out of the old ID, provide the password, then sign back in with the new ID.  If your password isn't accepted to sign out of the old ID, go through the steps in this article: If you're asked for the password to your previous Apple ID when signing out of iCloud.  The last one (change your ID temporarily) will usually fix things.

  • Help needed in providing conditional hyperlinks in report

    Hi,
    I need to apply links to a number column in my report. But depending on another column value, I need to link my number column to page 1 or 2 or 3. How can I achieve this conditional linking in APEX? I cant give links or href tag in my query as then all number formatting would be lost.
    A more detailed view:
    Col 1 Col2
    1 100.00 --no link to be given here
    1 20.00 -- no link
    2 123,45.00 --link must go to page 3
    3 35,001.40 -- link must go to page 4
    Any ideas/suggestiones would be welcome.
    Thanks & Regards,
    Sumana

    Sorry for the late reply Andy. I guess u have not got my point entirely. I will explain more clearly. I had already used case statement before I posted my previous post.
    Now the entire column is displayd in a font which is similar to having a hyperlink. (brown font with mousever effect too). I dont want that. any way to remove it?
    I need as shown below E.g.,
    col1 col2
    row 1 100,00 50.00 -- normal balck font
    row 2 300.00 150.00 hyperlink (link) font - brown color etc. links to pqge 1
    row 3 16.75 10.00 -- hyperlink (link) font - to different page. -- links to page 4
    row4 20.76 35.67--no link -- normal balck font.
    But now all row have amounts in brown color.
    Thanks
    Sumana

  • Help needed in debugging callablestatement changing performance

    Looking for some help debugging a performance problem.
    We are in the process of converting an ASP web application running on IIS to a java web application running on OAS. We have java code using a CallableStatement that calls an Oracle PL/SQL Procedure that runs inserts and updates as needed and does not return anything.
    When the Java application calls the procedure using the same parameters and doing the exact same work the execution time is either 3 minutes or 30 minutes. We have narrowed down the location of the slowdown and when it takes 30 minutes to execute it appears to be hanging during a cursor execution. What would cause the execution times to vary so much?
    Here's another piece to the puzzle. When the procedure is called from IIS with the exact same parameters that were used from OAS the procedure ALWAYS runs in 3 minutes. Why would IIS performance be so consistent and OAS so inconsistent?
    Any debugging suggestions would be greatly appreciated.
    Thanks,
    Bob

    user4908334 wrote:
    We are in the process of converting an ASP web application running on IIS to a java web application running on OAS. We have java code using a CallableStatement that calls an Oracle PL/SQL Procedure that runs inserts and updates as needed and does not return anything.
    More information is needed on that.
    There is one proc or 50?
    The proc is being called one time or 50 times?
    You are not using Batching right?
    When the procedure is called from IIS with the exact same parameters that were used from OAS the procedure ALWAYS runs in 3 minutesYou are running the java server on exactly the same box as IIS?
    The java code is using exactly the same database as IIS? (Did you verify this?)

  • More issues with 7.4.1 & 7.4.2  - help needed : tried the usual fixes.....

    I have the dual band 2.4 or 5GHz model AEBS, Belkin powered 4 port hub, Canon IP1600 printer, 40GB & 120 GB HFS+ USB drives. Win 7 64bit & XP machines.
    I only 2 weeks ago did the FW upgrade.
    With prior to these 2 FW's, i had issues with my printer not printing the whole page, it would always cut mid last line and then freeze. Had to cycle the printer to get the page out. It would not necessarily print the 2nd time either. The HDD's going through a hub worked fine. I updated to 7.4.1 hoping that would fix the printer issue, it did not. I then began getting "disk repair needed" on both HDD's over the next week; culminating upon both HD's going corrupt.
    I reformatted both and moved all my music/movies back, and all was good for a week. Then today, turned both drives on at different times, and both need disc repair again.
    So i unplugged them and hooked them up to my Linux Mint rig, and there was no apparent corruption, and all the files were playable.
    SO I updated to 7.4.2 tonight, and the printer issue is still happening. BUT the 2 HDD are just fine now, after the update....so this leads me to think there was/is an issue with the router? Oh, i tried to directly plug the HDD into the router as well b4 the most recent update but still disc needs repair....of course they have been working fine for the last 2 hours...
    Anyone have any ideas? Im ready to pull my hair out...Thanks in advance.
    Message was edited by: user2009

    Hey Chris, thanks for responding, in my above post I mentioned my troubleshooting:
    Since updating my iPhone 5S (T-Mobile) to both 8.0.1 and then 8.0.2 I've had more issues than I've ever had with any iOS in the past (with the exception of iPhone 4 running iOS 7, but clearly that is an older phone, not a 1 year old model like the 5S). Have tried resetting, powering off, etc too by the way.

  • Help needed trying make thumbnails from large Image Files

    I posted this to the Flex message bored, too. I didn't notice
    the Actionscript 3.0 until after. Sorry. Anyway, I have some
    ActionScript 3.0 code, created with Flex that will load a large
    JPEG image (say 3000x2000 pixels) that I'm trying to create a 100
    pixel thumbnail. I have the code working where I generate the
    thumbnail, but it's not maintaining the aspect ratio of the
    original image. It's making it square, filling in white for the
    part that doesn't fit.
    I've tried just setting the height or width of the new
    image, but that doesnt render well, either.
    To see what I'm talking about, I made a screen shot, showing
    the before image, and the rendered as thumbnail image:
    Image of demo
    app at Flickr.
    Now, there's a few things important to note. I'm saving the
    thumbnail off as a JPEG. As you can see in my sample application,
    the original renders fine with the proper aspect ratio, it's when
    I'm copying the bytes off the bitmapdata object, where I need to
    specify a width and height, that the trouble starts. I've also
    tried using .contentHeight and .contentWidth and some division to
    manually specify a new bitmapdatasize, but these values seem to
    always have NaN.
    private function makeThumbnail():void{
    // create a thumbnail of 100x100 pixels of a large file
    // What I want to create is a a thumbnail with the longest
    size of the aspect
    // ratio to be 100 pixels.
    var img:Image = new Image();
    //Add this event listener because we cant copy the
    BitmapData from an
    /// image until it is loaded.
    img.addEventListener(FlexEvent.UPDATE_COMPLETE,
    imageLoaded);
    img.width=100;
    img.height=100;
    img.scaleContent=true;
    img.visible = true;
    // This is the image we want to make a thumbnail of.
    img.load("file:///C:/T5.jpg");
    img.id = "testImage";
    this.addChildAt(img, 0);
    private function imageLoaded(event:Event):void
    // Grab the bitmap image from the Input Image and
    var bmd:BitmapData =
    getBitmapDataFromUIComponent(UIComponent(event.target));
    //Render the new thumbnail in the UI to see what it looks
    theImage.source = new Bitmap(bmd); //new Bitmap(bmd);
    public static function
    getBitmapDataFromUIComponent(component:UIComponent):BitmapData
    var bmd:BitmapData = new
    BitmapData(component.width,component.height );
    bmd.draw(component);
    return bmd;
    }

    Hi Tod,
    Take a look at this post:
    I'll have to say the smoothing of the thumb is not perfect, but maybe in combination with your code.. you get good results.
    Post a solution if you acheive better smooth thumb results.
    Link to forum post:http://forums.adobe.com/message/260127#260127
    Greets, Jacob

  • Help needed to "map" HRMS fields for reporting

    Hi all,
    I have been asked to map for reporting purposes all the fields in the HRMS person and assignment forms, plus vacany requisition and absence.
    For example, on the people form in HRMS the "last Name" field would translate into sql as "per_people_F.last_name".
    I have found all the person/assignment/absence and vacancy fields but cannot find any of the following:
    Bank account/ pay method information.
    Salary previous/ salary proposal form information
    Anything from the element entries screen or the tax information fields.
    Anyone have any ideas which tables would hold this information for querying using developer or toad??

    Hi Michel, Vijaya, Praksh
    Thanks for all the replies. I will be a bit more detailed in my Query and Vijaya if u cud explain me the same way then it wud be helpful...
    Idoc Structure:
    GLMAST01
    IDOC
      BEGIN
    --EDI_DC40
         SEGEMENT
        TABNAM
    --E1SKA1M
         SEGMENT
        MSGFN
        KTOPl
        SAKNR
      --E1SKATM
         SEGMENT
         MSGFN
      --E1SKB1M
         SEGMENT
         MSGFN
    The Message type is
    FCC_MSGTYPE
    -MOVEMENT
      -Row
        MANDT
        KTOPL
        SAKNR
    I am not sure whether to Map the MOVEMENT part. Tell me what I should do. The requirement is to populate the R/3 with the MANDT, KTOPL, SAKNR etc which all occur in the E1SKA1M segemnt and the nothing to the subsegments under it.
    Please tell me how to do that.
    Thanking all in anticipation.
    Best Regards
    Chakra and Somnath

  • Help Needed Trying To Publish To Web

    i am new to this so go easy!
    i have oracle portal running fine, with a basic installation linking to another machine runnnig the db. all is working great - and i have developed a small site which is pulling through data correctly etc - and looks great.
    the server name it is running on is "SVORAAS" so to access and do any development ive been typing into the browser "http://svoraas/pls" and then loging in etc. i have set different users up with correct access etc.
    now - i have registed a domain name - and this machine is behind the fire wall with ip 212.58.xxx.xx and name www.clixxx.co.uk
    however what do i need to do so that the oracle apps server "serves" to www.clixxx.co.uk so i can type in to any browser on the internet http://www.clixxx.xo.uk/pls and be able to login to see the stuff i have done
    i have played around with http.conf files and numerous other things like DAD/SSO's etc which i have no idea about!
    basically i want to be able for people on the net to have access to the stuff ive developed! surely this is normal - but i cant find anything to help me out!
    tim

    More to it than just the httpd.conf. If you have metalink access, review Note:218031.1 Subject: Configuring Multiple URLs With Portal 9.0.2 Using Virtual Hosts

  • Applescript help needed: Trying to recreate this .bat file...

    Uh oh, perhaps I put this in the wrong forum:)
    http://discussions.apple.com/thread.jspa?threadID=2611596&tstart=0
    thanks!!!

    Spaces are used to delimit the commands and terms on the command line, so to use something with a space (or other characters special to the shell) you will need to escape it (by using a backslash in front of the character to escape) or put the term in quotes. Also, in order to pass parameters to the executable (I am guessing that you are passing command line parameters to the game)), you will need to use the path to the executable in the application bundle, otherwise it will get launched as a regular application.
    I don't know what the name of the executable is, but it should be located in the Contents/MacOS folder in the bundle (right-click the application and choose Show Package Contents) - you can drag file items to the Terminal window to get a properly escaped path. The command in the Terminal (or an AppleScript do shell script command) would look something like:/Applications/Games/Butt/Battlefield 1942 The Road To Rome/Contents/MacOS/theExecutableName +game XPack2or'Applications/Games/Butt/Battlefield 1942 The Road To Rome/Contents/MacOS/theExecutableName' +game XPack2

  • Help Needed REP-1800 Formatter error VGS-1701 Not enough memory

    Hi. Gents
    Help needed
    I’m working on a Report, it gets some 2 million records and the report pages are approximately 52,000
    It works fine if the pages are lesser then 48,000 or the data is less let say one and half a million, the problem occurs only after 48000 + pages formatted.
    Report is generated successfully when trying to go to the last page it throw an error.
    REP-1800 Formatter error
    VGS-1701 Not enough memory
    I have already gone through the metalink DOC Id 95505.1 as well as OTN
    But all in vain,
    Any comments or help much appreciated.
    Details are:
    Reports 6i (Clients/Server) on Windows platform
    (Windows XP Professional with SP 2)
    Database: Oracle9i Enterprise Edition Release 9.2.0.5.0
    Computer:
    Pentium(R) 4, CPU 3.00GHz, 1 GB of RAM
    Still 20 GB free space
    Thanks & Regards

    I don't see the point in making a report with more than 48,000 pages, I think Al Gore will not be happy when you start printing it...
    The problem might be caused by the fact that Reports needs to format all output at once, and then even 1GB of memory will probably be not enough. Formatting all pages at once is needed if you use pagination with displaying total number of pages. If you have this, try to get that out of the report definition and try again.

  • Programatically changing the id of a component

    Hi!
    I'm trying to solve the problem of duplicate id, without havind to manually give an id to all components.
    To accomplish this, i was trying to programatically change the id of all components that have the id null or that the id begun with _id with an PhaseListener.
    But i don't achive any results.
    Does anyone know how to do this?
    Thanks.

    Hi,
    Check View States.
    http://help.adobe.com/en_US/flex/using/WS2db454920e96a9e51e63e3d11c0bf63611-7ff1.html

  • Urgent help needed on oracle queueing

    Hi
    we have created AQ tables and queues but are facing with the following errors
    Thu Aug 30 17:25:31 2007
    Errors in file e:\orant\ora9i\pds\udump\pds_ora_4092.trc:
    ORA-00600: internal error code, arguments: [opidor: call 1], [], [], [], [], [], [], []
    Thu Aug 30 17:44:17 2007
    Errors in file e:\orant\ora9i\pds\udump\pds_ora_4092.trc:
    ORA-00600: internal error code, arguments: [17281], [1001], [0x25EBB628], [], [], [], [], []
    ORA-01001: invalid cursor
    Thu Aug 30 17:44:17 2007
    Errors in file e:\orant\ora9i\pds\udump\pds_ora_4092.trc:
    ORA-00600: internal error code, arguments: [17281], [1001], [0x25EBB628], [], [], [], [], []
    ORA-01001: invalid cursor
    ORA-00600: internal error code, arguments: [17281], [1001], [0x25EBB628], [], [], [], [], []
    ORA-01001: invalid cursor
    help needed asap
    thanx

    ORA-600 should be reported to Oracle support with trace files and alertlog.
    Well the following note may help you:
    Note: 433389.1
    Hope this Helps
    Regards

  • How can I programatically change a reference to an item in a cluster?

    Hello!
    I'm trying to programatically change the text background color of the elements in a large cluster.
    I'm using LabVIEW 2010 SP1.  Attached is a test vi that I'm expermimenting with.  The test cluster has 6 elements and the final cluster will have 140.
    All elements will be the same data type.
    Based on the rate of change of the element value, I have to change the background color.
    Instead of creating a reference for each element in the cluster (as in my test vi), I'm looking for a way of changing the reference programatically.  Is there a way?
    I'm also considering building an array of references as a brute force alternative but I would like to see if there is something more elegant / efficient first!
    Am I making sense?
    thanks,
    mike
    Solved!
    Go to Solution.
    Attachments:
    cluster_color_change.vi ‏11 KB

    Mike,
    You can get references to the elements inside the cluster from the cluster reference using property node: All Objects[].  This is an array of references to the controls inside the cluster.
    Another way which might have advantages is to put a color box indicator behind each numeric.  Color the numeric backgrounds Transparent.  Then write the color to the color box.  I did a quick modification to your VI to show this possibility.  I did not adjust the size of the color box to match the numeric to emphasize what I did.
    Lynn
    Another note: If any of your users are color blind some of the combinations (black on red) might not be very visible.
    Attachments:
    cluster_color_change.2.vi ‏9 KB

  • Help needed. I have a 3TB external hard drive partitioned into 1TB's. I used one partition as backup for the main computer hard drive. But now it is greyed out as shown in the disk utility and its name changed, i dont know how that happened, i tried verif

    Help needed. I have a 3TB external hard drive partitioned into 1TB's. I used one partition as backup for the main computer hard drive. But now it is greyed out as shown in the disk utility and its name changed, i dont know how that happened, i tried verifying and repairing it but had no luck. I also tried mounting and unmounting it but still no solution. Anyone to help please?

    Looks bad. I would strongly advise backing up the stuff on the other two partitions as soon as possible in case the rest of the drive goes wrong.
    Beyond that, Disk Utility has limited abilities to repair disks, DiskWarrior uses a different approach and might, emphasis might be more successful. It has certainly done the job for me in the past when Disk Utility could not.
    See http://www.alsoft.com/diskwarrior/

Maybe you are looking for

  • Missing subject line in BW Process Chain Messages

    Hi Experts! We are using BW3.5 (Support pack 16) process chains. There are a number of process chains and almost every thing is working fine. But 2 process chains, send message without any subject into the email. I did a number of tricks e.g. reactiv

  • Error while loading throug sql loader

    Hi All, Trying to use sql loader in order to laod csv format data. However, during load, I come across with errors. Please find below my log,control and datafile. ------------Ctl File---------------- load data discardfile 'c:\dis.log' infile      'c:

  • Printing jewel case insert no longer works... HELP

    Itunes problem.  Printing jewel case insert no longer works since installing Itunes 11.0.2... Song listings are jumbled.  HELP

  • Develop changes not showing in Library preview

    Changes made in Develop Module are not visible in Library Module. This has never happened before. In Dev Mod it takes a few seconds for the image to load and show the adjustments I made to color and shadows. As soon as I click back to Library the cha

  • Installing 32 bit Premiere Elements 12 problems

    I purchased my upgrades to Elements and Premiere 12 today.  They downloaded just fine.  Elements installed just fine. Premiere downloaded and extracted just fine.  The install however failed noting that I was trying to install the 64 bit version.  I