The Origin Forum
File Exchange
Try Origin for Free
The Origin Forum
Home | Profile | Register | Active Topics | Members | Search | FAQ | Send File to Tech support
Username:
Password:
Save Password
Forgot your Password? | Admin Options

 All Forums
 Origin Forum for Programming
 Forum for Origin C
 Opening Project with reports
 New Topic  Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic Lock Topic Edit Topic Delete Topic New Topic Reply to Topic

rikseventyseven

Switzerland
10 Posts

Posted - 09/15/2009 :  09:47:23 AM  Show Profile  Edit Topic  Reply with Quote  View user's IP address  Delete Topic
Dear Developers,

I recently managed to implement in my originc program the generation of a report.
The report is generated using data calculated from imported datasets.
Now what happened is that I had all my nice reports with tables and graphs saved in a project. Today I opened the origin file and the graphs in the report were gone! AAAAAAAH!!! Ouch!!!! The original graphs were indeed there... I don't understand this.

How can I change my program in order to have the graphs persistently attached to the report?!?! Any idea?!

Thanks a lot. R

Origin Ver. 8. and Service Release SR5 (Select Help-->About Origin):
Operating System: XP

-------------------------------
"Stay hungry, stay foolish."

Iris_Bai

China
Posts

Posted - 09/15/2009 :  10:36:57 PM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
Hi,

We used the example function in this linking http://ocwiki.originlab.com/index.php?title=OriginC:Report_with_Multiple_Tables, cannot reproduce this problem both in Origin80 SR5 and SR6.

Could you compare your programming code with this example function? Any more question, could you post your code here or Send to me?


Iris
Go to Top of Page

rikseventyseven

Switzerland
10 Posts

Posted - 09/16/2009 :  07:49:30 AM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
Thanks for the answer.
The code works and now I solved the problem.
Somehow I followed the instruction in the OriginC Help based on pictureholders.

trR.Report.Table4.ID = nID++;
trR.Report.Table4.SetAttribute(STR_LABEL_ATTRIB, "VI - Graph"); // Table title. If not set this, will show as empty here
trR.Report.Table4.SetAttribute(TREE_Table, nTableFormat|GETNBRANCH_HIDE_ROW_LABELS);
trR.Report.Table4.SetAttribute(TREE_Control, ONODETYPE_EMBED_GRAPH);

PictureHolder pictHolder;
if( !page_get_picture(gp, pictHolder, "EMF", 288, false) )
{
printf("failed to create EMF from graph\n");
}
trR.Report.Table4.Graph1.ID = nID++;
trR.Report.Table4.Graph1.pict = pictHolder;
trR.Report.Table4.Graph1.pict.GetWidth();

I think that is the reason. Indeed I ignore why with the method that I used before the graphs were not anymore there when I reopened a project with reports.

Now, the problem is the following: When I embed graphs in a report they do not appear anymore as "standard" graphs. When I was using the pictureholders, I had miniatures of the graphs in the report and still standard graphs in the origin project. This was convenient because sometimes I needed to further analyze those data.
How to circumvent this? Shall I generate copies of the graphs before embedding them in the report? Is there a quick way to duplicate an existing graph?

Thanks indeed for the first answer!

-R

-------------------------------
"Stay hungry, stay foolish."
Go to Top of Page

Iris_Bai

China
Posts

Posted - 09/16/2009 :  10:44:15 PM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
Hi,

The embedded graph in report still is a real Origin Graph, you can double click to open it and change settings on graph, close it, the changes will be applied back to report graph.

In Origin C programming, still can attach GraphPage object to a report graph by page name, for example:

// before embed 
GraphPage gp;
gp.Create();
gp.Rename("Sample1"); // set name as Sample1

// ....codes to generate report with graph

// access graphs in report
GraphPage gpReport("Sample1"); 




Iris
Go to Top of Page
  Previous Topic Topic Next Topic Lock Topic Edit Topic Delete Topic New Topic Reply to Topic
 New Topic  Reply to Topic
 Printer Friendly
Jump To:
The Origin Forum © 2020 Originlab Corporation Go To Top Of Page
Snitz Forums 2000