encapsulated pivottable into a .Net application; drag/drop errors...

J

Jéjé

Hi,

I want to create a windows application where I can use the pivottable.
but I want to do a drag and drop from my application to the pivottable
instead-of using the pivotfield list of the pivottable himself.

I mean, I display my AS2005 metadata the user select a dimension from here
and drag/drop this dimension into the pivottable (same application like the
BI dev studio do)
but I receive a "FORMAT_TC" error.

so, what is the object I have to use in the "DoDragDrop" function in my .Net
code?
nother option is to disable the drag/drop support in the pivottable, how to
do this?

thanks.

Jerome.
 
A

Alvin Bruney - ASP.NET MVP

you are on the right track, just use the drop events to move the data. You
can get the actual data from the event handler. You would then need to add
the data to the pivot table cell as appropriate. You can find the cell
underneath the cursor by using the rangefrompoint method.

--
Warm Regards,
Alvin Bruney [MVP ASP.NET]

[Shameless Author plug]
The Microsoft Office Web Components Black Book with .NET
Now Available @ www.lulu.com/owc
Professional VSTO 2005 - Wrox/Wiley 2006
Blog: http://msmvps.com/blogs/Alvin/
 
J

Jéjé

I'm on the right track with a system error??? ;-)
After I call the "DoDragDrop" method, and when the mouse go over the
pivottable the error is raised.
any type of drag & drop cause the error.

I try to deactivate some options in the pivottable to not raise this error,
but nothing work.

have you any sample code to share?

Alvin Bruney - ASP.NET MVP said:
you are on the right track, just use the drop events to move the data. You
can get the actual data from the event handler. You would then need to add
the data to the pivot table cell as appropriate. You can find the cell
underneath the cursor by using the rangefrompoint method.

--
Warm Regards,
Alvin Bruney [MVP ASP.NET]

[Shameless Author plug]
The Microsoft Office Web Components Black Book with .NET
Now Available @ www.lulu.com/owc
Professional VSTO 2005 - Wrox/Wiley 2006
Blog: http://msmvps.com/blogs/Alvin/
-------------------------------------------------------



Jéjé said:
Hi,

I want to create a windows application where I can use the pivottable.
but I want to do a drag and drop from my application to the pivottable
instead-of using the pivotfield list of the pivottable himself.

I mean, I display my AS2005 metadata the user select a dimension from
here
and drag/drop this dimension into the pivottable (same application like the
BI dev studio do)
but I receive a "FORMAT_TC" error.

so, what is the object I have to use in the "DoDragDrop" function in my .Net
code?
nother option is to disable the drag/drop support in the pivottable, how to
do this?

thanks.

Jerome.
 
A

Alvin Bruney - ASP.NET MVP

The reason for your error is probably that you aren't casting to the right
type of object when you retrive the data from the dragrelease event. The
easiest way to determine the correct type is to run the application and
break when the exception is thrown. Examine the object and run the
..GetType() call in the immediate window. That will tell you what type the
object is. From that point, it's up to you to cast it appropriately.

--
Warm Regards,
Alvin Bruney [MVP ASP.NET]

[Shameless Author plug]
The Microsoft Office Web Components Black Book with .NET
Now Available @ www.lulu.com/owc
Professional VSTO 2005 - Wrox/Wiley 2006
Blog: http://msmvps.com/blogs/Alvin/
-------------------------------------------------------



Jéjé said:
I'm on the right track with a system error??? ;-)
After I call the "DoDragDrop" method, and when the mouse go over the
pivottable the error is raised.
any type of drag & drop cause the error.

I try to deactivate some options in the pivottable to not raise this error,
but nothing work.

have you any sample code to share?

Alvin Bruney - ASP.NET MVP said:
you are on the right track, just use the drop events to move the data. You
can get the actual data from the event handler. You would then need to add
the data to the pivot table cell as appropriate. You can find the cell
underneath the cursor by using the rangefrompoint method.

--
Warm Regards,
Alvin Bruney [MVP ASP.NET]

[Shameless Author plug]
The Microsoft Office Web Components Black Book with .NET
Now Available @ www.lulu.com/owc
Professional VSTO 2005 - Wrox/Wiley 2006
Blog: http://msmvps.com/blogs/Alvin/
-------------------------------------------------------



Jéjé said:
Hi,

I want to create a windows application where I can use the pivottable.
but I want to do a drag and drop from my application to the pivottable
instead-of using the pivotfield list of the pivottable himself.

I mean, I display my AS2005 metadata the user select a dimension from
here
and drag/drop this dimension into the pivottable (same application like the
BI dev studio do)
but I receive a "FORMAT_TC" error.

so, what is the object I have to use in the "DoDragDrop" function in my .Net
code?
nother option is to disable the drag/drop support in the pivottable,
how
to
do this?

thanks.

Jerome.
 
J

Jéjé

the problem is:
the error is on a mousemove event over the pivottable!

and what type of object I have to SEND to the pivottable?
the problem is: the pivottable doesn't recognize the object I try to send
using the drag/drop feature.
I have tried a lot of different objects, but the error still here:
PivotTableField object
simple string (like: measures.sales)

there is no dragrelease event, because the error occurs before I can release
my drag.
also, the error appears in a nonmanaged code, and any try / catch doesn't
works!

when I do the opposite way, I mean if I try to RECEIVE the pivottable
drag/drop object (Label1.DragDrop)
The object sent by the pivottable is a memorystream
and this code:
e.Data.GetFormats()

returns "fieldlist format"

but this information doesn't help me so much.



Alvin Bruney - ASP.NET MVP said:
The reason for your error is probably that you aren't casting to the right
type of object when you retrive the data from the dragrelease event. The
easiest way to determine the correct type is to run the application and
break when the exception is thrown. Examine the object and run the
.GetType() call in the immediate window. That will tell you what type the
object is. From that point, it's up to you to cast it appropriately.

--
Warm Regards,
Alvin Bruney [MVP ASP.NET]

[Shameless Author plug]
The Microsoft Office Web Components Black Book with .NET
Now Available @ www.lulu.com/owc
Professional VSTO 2005 - Wrox/Wiley 2006
Blog: http://msmvps.com/blogs/Alvin/
-------------------------------------------------------



Jéjé said:
I'm on the right track with a system error??? ;-)
After I call the "DoDragDrop" method, and when the mouse go over the
pivottable the error is raised.
any type of drag & drop cause the error.

I try to deactivate some options in the pivottable to not raise this error,
but nothing work.

have you any sample code to share?

Alvin Bruney - ASP.NET MVP said:
you are on the right track, just use the drop events to move the data. You
can get the actual data from the event handler. You would then need to add
the data to the pivot table cell as appropriate. You can find the cell
underneath the cursor by using the rangefrompoint method.

--
Warm Regards,
Alvin Bruney [MVP ASP.NET]

[Shameless Author plug]
The Microsoft Office Web Components Black Book with .NET
Now Available @ www.lulu.com/owc
Professional VSTO 2005 - Wrox/Wiley 2006
Blog: http://msmvps.com/blogs/Alvin/
-------------------------------------------------------



Hi,

I want to create a windows application where I can use the pivottable.
but I want to do a drag and drop from my application to the pivottable
instead-of using the pivotfield list of the pivottable himself.

I mean, I display my AS2005 metadata the user select a dimension from
here
and drag/drop this dimension into the pivottable (same application
like
the
BI dev studio do)
but I receive a "FORMAT_TC" error.

so, what is the object I have to use in the "DoDragDrop" function in
my
.Net
code?
nother option is to disable the drag/drop support in the pivottable, how
to
do this?

thanks.

Jerome.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top