Skip to main content



      Home
Home » Archived » BIRT » dataset property binding
dataset property binding [message #137655] Wed, 01 March 2006 12:58 Go to next message
Eclipse UserFriend
Originally posted by: vladperl.semanticprogrammer.org

How to use dataset property binding inside of the dialog "Edit Data Set"?
Please provide example to show using this property.
I understand how to use property binding for datasource but not for dataset.

Thank you,
Vladimir
Re: dataset property binding [message #137844 is a reply to message #137655] Thu, 02 March 2006 02:47 Go to previous messageGo to next message
Eclipse UserFriend
Vladimir,

I have a query in my data set that uses
Select * from Orders.

In the property binding, I can change my query text to
"Select * from Orders Where ordernumber =" + params["qp"];

Jason
"Vladimir" <vladperl@semanticprogrammer.org> wrote in message
news:du4nau$eml$1@utils.eclipse.org...
> How to use dataset property binding inside of the dialog "Edit Data Set"?
> Please provide example to show using this property.
> I understand how to use property binding for datasource but not for
> dataset.
>
> Thank you,
> Vladimir
>
Re: dataset property binding [message #138220 is a reply to message #137844] Thu, 02 March 2006 11:41 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: vladperl.semanticprogrammer.org

> I have a query in my data set that uses
> Select * from Orders.
>
> In the property binding, I can change my query text to
> "Select * from Orders Where ordernumber =" + params["qp"];
>
> Jason
> "Vladimir" <vladperl@semanticprogrammer.org> wrote in message
> news:du4nau$eml$1@utils.eclipse.org...
>> How to use dataset property binding inside of the dialog "Edit Data Set"?
>> Please provide example to show using this property.
>> I understand how to use property binding for datasource but not for
>> dataset.

Thank you Jason for your clean answer.
I suppose that is good idea to put this example in user guide.
One more question on this topic.
I'm usually in query put sign question in place of parameter and later make
binding
dataset parameter with report parameter with help property editor table.
Could you provide advice which approach is better?
Looks like using data set property binding make more sense.
For query where I have more than one parameter with same supplied value
dataset property binding preferred choise.
It's usually case with union kind of query. To see my point here is example
of ugly query:

select PackingSlipItem.inventoryItem_id InventoryItemID,Product.name as
Product,

Unit.name as Unit,Sum(PackingSlipItem.quantity) Received, 0 as Allocated,

InventoryItem.unitsInStock

from PackingSlip join PackingSlipItem on
(PackingSlip.id=PackingSlipItem.packingSlip_id)

join InventoryItem on (PackingSlipItem.inventoryItem_id = InventoryItem.id)

join Product on (PackingSlipItem.product_id = Product.id)

join Unit on (PackingSlipItem.unit_id=Unit.id)

where PackingSlip.date between ? and ?

Group by PackingSlipItem.inventoryItem_id,Product,Unit.name

union

select InvoiceItem.inventoryItem_id InventoryItemID,Product.name as Product,

Unit.name as Unit, 0 as Received, Sum(InvoiceItem.quantity) Allocated,

InventoryItem.unitsInStock

from Invoice join InvoiceItem on (Invoice.id=InvoiceItem.invoice_id)

join InventoryItem on (InvoiceItem.inventoryItem_id = InventoryItem.id)

join Product on (InvoiceItem.product_id=Product.id)

join Unit on (InvoiceItem.unit_id=Unit.id)

where Invoice.date between ? and ?

Group by InvoiceItem.InventoryItem_id,Product,Unit.name

union

select InventoryItem.id InventoryItemID, Product.name as Product,

Unit.name as Unit, 0 as Received, 0 as Allocated,

InventoryItem.unitsInStock

from InventoryItem

join Product on (InventoryItem.product_id=Product.id)

join Unit on (InventoryItem.unit_id=Unit.id)

where

not exists(

select Item.id from Invoice

join InvoiceItem on (Invoice.id=InvoiceItem.invoice_id)

join InventoryItem as Item on (InvoiceItem.inventoryItem_id = Item.id)

where Invoice.date between ? and ? and (Item.id = InventoryItem.id)

)

and

not exists(

select Item.id from PackingSlip

join PackingSlipItem on (PackingSlip.id=PackingSlipItem.packingSlip_id)

join InventoryItem as Item on (PackingSlipItem.inventoryItem_id = Item.id)

where PackingSlip.date between ? and ? and (Item.id = InventoryItem.id)

)

Group by InventoryItem.id,Product,Unit.name

order by Product
Re: dataset property binding [message #139659 is a reply to message #138220] Mon, 06 March 2006 10:30 Go to previous messageGo to next message
Eclipse UserFriend
Vladimir,

Sorry for the late response.
From a performance issue I dont know if either has an advantage.
From an understanding point I believe it would be better to use Dataset
parameters binding to report parameters.

Jason

"Vladimir" <vladperl@semanticprogrammer.org> wrote in message
news:du774t$2b5$1@utils.eclipse.org...
>> I have a query in my data set that uses
>> Select * from Orders.
>>
>> In the property binding, I can change my query text to
>> "Select * from Orders Where ordernumber =" + params["qp"];
>>
>> Jason
>> "Vladimir" <vladperl@semanticprogrammer.org> wrote in message
>> news:du4nau$eml$1@utils.eclipse.org...
>>> How to use dataset property binding inside of the dialog "Edit Data
>>> Set"?
>>> Please provide example to show using this property.
>>> I understand how to use property binding for datasource but not for
>>> dataset.
>
> Thank you Jason for your clean answer.
> I suppose that is good idea to put this example in user guide.
> One more question on this topic.
> I'm usually in query put sign question in place of parameter and later
> make binding
> dataset parameter with report parameter with help property editor table.
> Could you provide advice which approach is better?
> Looks like using data set property binding make more sense.
> For query where I have more than one parameter with same supplied value
> dataset property binding preferred choise.
> It's usually case with union kind of query. To see my point here is
> example of ugly query:
>
> select PackingSlipItem.inventoryItem_id InventoryItemID,Product.name as
> Product,
>
> Unit.name as Unit,Sum(PackingSlipItem.quantity) Received, 0 as Allocated,
>
> InventoryItem.unitsInStock
>
> from PackingSlip join PackingSlipItem on
> (PackingSlip.id=PackingSlipItem.packingSlip_id)
>
> join InventoryItem on (PackingSlipItem.inventoryItem_id =
> InventoryItem.id)
>
> join Product on (PackingSlipItem.product_id = Product.id)
>
> join Unit on (PackingSlipItem.unit_id=Unit.id)
>
> where PackingSlip.date between ? and ?
>
> Group by PackingSlipItem.inventoryItem_id,Product,Unit.name
>
> union
>
> select InvoiceItem.inventoryItem_id InventoryItemID,Product.name as
> Product,
>
> Unit.name as Unit, 0 as Received, Sum(InvoiceItem.quantity) Allocated,
>
> InventoryItem.unitsInStock
>
> from Invoice join InvoiceItem on (Invoice.id=InvoiceItem.invoice_id)
>
> join InventoryItem on (InvoiceItem.inventoryItem_id = InventoryItem.id)
>
> join Product on (InvoiceItem.product_id=Product.id)
>
> join Unit on (InvoiceItem.unit_id=Unit.id)
>
> where Invoice.date between ? and ?
>
> Group by InvoiceItem.InventoryItem_id,Product,Unit.name
>
> union
>
> select InventoryItem.id InventoryItemID, Product.name as Product,
>
> Unit.name as Unit, 0 as Received, 0 as Allocated,
>
> InventoryItem.unitsInStock
>
> from InventoryItem
>
> join Product on (InventoryItem.product_id=Product.id)
>
> join Unit on (InventoryItem.unit_id=Unit.id)
>
> where
>
> not exists(
>
> select Item.id from Invoice
>
> join InvoiceItem on (Invoice.id=InvoiceItem.invoice_id)
>
> join InventoryItem as Item on (InvoiceItem.inventoryItem_id = Item.id)
>
> where Invoice.date between ? and ? and (Item.id = InventoryItem.id)
>
> )
>
> and
>
> not exists(
>
> select Item.id from PackingSlip
>
> join PackingSlipItem on (PackingSlip.id=PackingSlipItem.packingSlip_id)
>
> join InventoryItem as Item on (PackingSlipItem.inventoryItem_id = Item.id)
>
> where PackingSlip.date between ? and ? and (Item.id = InventoryItem.id)
>
> )
>
> Group by InventoryItem.id,Product,Unit.name
>
> order by Product
>
>
>
Re: dataset property binding [message #139695 is a reply to message #137844] Mon, 06 March 2006 10:59 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: david.peterson.mtvnmix.com

Instead of using "Select * from Orders Where ordernumber =" +
params["qp"]";
Is there a way to use a different dataset other than the one that I'm in?

"+rows['qp']"; doesn't work because 'qp' for me is in another dataset.
Re: dataset property binding [message #139773 is a reply to message #139695] Mon, 06 March 2006 11:47 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: vladperl.semanticprogrammer.org

> Instead of using "Select * from Orders Where ordernumber =" +
> params["qp"]";
> Is there a way to use a different dataset other than the one that I'm in?
>
> "+rows['qp']"; doesn't work because 'qp' for me is in another dataset.

if (params["list"] == "customer") {
"select * from customers"
}
else {
"select * from employees"
}
Re: dataset property binding [message #140014 is a reply to message #139659] Mon, 06 March 2006 16:49 Go to previous message
Eclipse UserFriend
Originally posted by: vladperl.semanticprogrammer.org

> Sorry for the late response.
> From a performance issue I dont know if either has an advantage.
> From an understanding point I believe it would be better to use Dataset
> parameters binding to report parameters.

Thank you for answer, Jason
I really appreciate your help.
I have couple more questions :)

1) I have tried to use date type parameter with dataset parameter binded to
parameter directly in query but it doesn't work.
When I have used dataset parameters binded to report parameters in same
situation it works.
See the following:

dataset parameter binded directly in query(this doesn't work):

if (params["utilizedItemsOnly"]) {
packingSlipSQL += "where PackingSlip.date between "+params["startDate"]+"
and "+
params["endDate"];
packingSlipSQL += " group by
PackingSlipItem.inventoryItem_id,Product,Unit.name ";
}
else {
inventoryAllSQL += "where PackingSlip.date between "+params["startDate"]+"
and "+
params["endDate"];
inventoryAllSQL += " group by
PackingSlipItem.inventoryItem_id,Product,Unit.name ";
}

dataset parameter binded indirectly to report parameter (this works):

if (params["utilizedItemsOnly"]) {
packingSlipSQL += "where PackingSlip.date between "+"?"+" and "+
"?" + " group by PackingSlipItem.inventoryItem_id,Product,Unit.name ";
}
else {
inventoryAllSQL += "where PackingSlip.date between "+"?"+" and "+
"?" + " group by PackingSlipItem.inventoryItem_id,Product,Unit.name ";
}

If parameter is not type of date both approaches work fine.

2) I have case when datasets are used in same dataset property binding and
they have different number of parameters.
It seems I have to use dataset parameter directly binded in query approach
for datasets with different number of parameters.
Probably I can use dataset parameter binded indirectly to report parameter
approach only if
I will make fake parameters to get number of dataset parameters equal.
Otherwise I can't avoid run-time errors .

I'd like to have some comments on the situation.

Thanks,
Vladimir
Previous Topic:Date Footer
Next Topic:Getting 2.1M5 to run. Plugin not found.
Goto Forum:
  


Current Time: Tue Jul 22 13:53:13 EDT 2025

Powered by FUDForum. Page generated in 0.27765 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top