?
Solved

How couldt I share data between a DS report and a datawindow control ??

Posted on 2003-02-26
6
Medium Priority
?
1,449 Views
Last Modified: 2013-12-26
Hi,

I have a composite datastore report (lds_1) in it contains several datawindows.
I now need to share lds_1 with dw_1 (for preview) by doing

lds_1.sharedata(dw_1)

The result is an empty dw2. Does anybody know what is wrong?

Thanks
CVince
0
Comment
Question by:cvince
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 3
  • 2
6 Comments
 
LVL 2

Expert Comment

by:EAServer
ID: 8027061
I've never tried ShareData with a composite datawindow, but I don't think that it would work.  Sharedata basically shares the primary buffer of two datawindows.  Composite datawindows don't really have a primary buffer.
Besides, sharedata is going to be limited in this context, because and Modify() functions you applied to the source datawindow won't be shared with the secondary datawindow since it shares the data only and no formatting.


Instead, use GetFullState/SetFullState to basically make a copy of your datastore

blob lblb_data

lds_1.GetFullState(lblb_data)
dw_1.SetFullState(lblb_data)
0
 

Expert Comment

by:gokulrkalpathi
ID: 8045163
Hi
Try creating a child datawindow using the getchild() function for the childdatawindow in the datastore from which u want to share the data, then try sharing the data , i have not tried it , but it should work !!!.

best regards
Gokul Kalpathi
0
 
LVL 2

Expert Comment

by:EAServer
ID: 8045204
Gokul
Yep that works, don't know why I didn't think of it earlier, I've had to do this in the past with nested datawindows, but not composite.  But I'd still probably use the fullstate methods as that will carry formatting changes as well as the data.

0
VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

 

Author Comment

by:cvince
ID: 8047779
I tried this :

datawindowchild child1, child2

lds_1.getChild ("dw_data1", child1)
lds_1.getChild ("dw_data2", child2)
...

dw_1.getChild ("dw_data1", child3)
dw_1.getChild ("dw_data2", child4)
...

child1.sharedata (child3)
child2.sharedata (child4)
...

But it doesn't work !!...


I noticed that if i've a composite datastore and i tried to share it whith 2 other dw, sharing was ok. But with another composite, it seems to be impossible !
0
 
LVL 2

Accepted Solution

by:
EAServer earned 450 total points
ID: 8054744
Have you tried the get/setfullstate functions?  I'd recommend this method with print previews anyhow because you'll want to retain any changes in formatting.  I realize in your situation of having a composite in a datastore that dynamic formatting probably isn't an issue, but I think it is worth trying.

Typically I create a standard print preview window to display all reports in a print preview mode by simply opening it with parm and passing the blob from a getfullstate, then I can reuse my window throughout my entire application.

Your sharedata logic looks good, what return value do you get from your sharedata funtion?

0
 

Author Comment

by:cvince
ID: 8119465
I tried 3 ways to use sharedata :
Share a DW with a DW in a composite -> OK
Share a DW in a composite with a DW -> Don't work
Share a DW in a composite with another DW in a composite -> Don't work.

Another ways is to use the rowscopy ! It's work !!! ;o)

And getFullState/setFullState works too ! this methods is speeder than other !

PS : the return code for the sharedata in the previous example is -1.

---------------------------------------------

Now I need to do this with a report that contain a regular DW and a DW OLE object (Graphique Microsoft Graph 2000).

All the DW are copied from the reports 1 to the reports 2, but the graph does not appear in the second report !!! Just in the first !!!

dataWindowChild     child_1, child_2, child_3, child_4, ldwc_Graph
int     li_rc

// DW...
dw_1.dataObject = "d_report_graph"
dw_2.dataObject = "d_report_graph2"

li_rc = dw_1.setTransObject (SQLCA)
li_rc = dw_1.retrieve ()

// Graph construction...
li_rc = dw_1.GetChild('dw_graph', ldwc_Graph)

ldwc_Graph.Reset()

ldwc_Graph.InsertRow(0)
ldwc_Graph.SetItem(1,"serie","")
ldwc_Graph.SetItem(1,"cat1","ABC")
ldwc_Graph.SetItem(1,"cat2","ABCD")
ldwc_Graph.SetItem(1,"cat3","ABCDE")
ldwc_Graph.SetItem(1,"cat4","ABCDEF")

ldwc_Graph.InsertRow(0)
ldwc_Graph.SetItem(2,"serie","Indice")
ldwc_Graph.SetItem(2,"cat1","103")
ldwc_Graph.SetItem(2,"cat2","100")
ldwc_Graph.SetItem(2,"cat3","102")
ldwc_Graph.SetItem(2,"cat4","96")

dw_1.getChild ("dw_trace", child_1)
dw_1.getChild ("dw_graph", child_2)
dw_2.getChild ("dw_trace", child_3)
dw_2.getChild ("dw_graph", child_4)

child_1.RowsCopy (1, child_1.rowCount (), primary!, child_3, 1, primary! )
child_2.RowsCopy (1, child_2.rowCount (), primary!, child_4, 1, primary! )

All the return code are OK ! But the grahp still not copied...



0

Featured Post

VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Here is a helpful source code for C++ Builder programmers that allows you to manage and manipulate HTML content from C++ code, while also handling HTML events like onclick, onmouseover, ... Some objects defined and used in this source include: …
Jaspersoft Studio is a plugin for Eclipse that lets you create reports from a datasource.  In this article, we'll go over creating a report from a default template and setting up a datasource that connects to your database.
The viewer will learn how to synchronize PHP projects with a remote server in NetBeans IDE 8.0 for Windows.
The viewer will learn how to use and create new code templates in NetBeans IDE 8.0 for Windows.
Suggested Courses

770 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question