carlosl
03-22-2007, 06:24 AM
hi ppl...
How, in macro(OOo Basic) on OO.o Writer, i insert data of query in a listbox??
thank's
homes
05-23-2007, 04:54 PM
Discupa por el idioma pero tengo esto para ti..
function MostrarUsuarios()
-- On Select ComboBox1, I send the selected variable value to sQuery.
ncompany = ComboBox.GetSelected("ComboBox1")
scompany = ComboBox.GetItemText("ComboBox1", ncompany);
sUsersQuery = "SELECT Id,Titulo,Resumen FROM myUsers WHERE Autores ='"..scompany.."'";
tUsers = SQLite.QueryToTable(db,sUsersQuery);
--3. Once the query is completed, I will populate ComboBox2.
--Disable Updating
ComboBox.SetUpdate("ComboBox2", false);
ComboBox.ResetContent("ComboBox2");
if tUsers and tUsers.Rows > 0 then
for i=1,tUsers.Rows do
sName = tUsers.Data[i]["Titulo"];
sEmail = tUsers.Data[i]["Resumen"];
sId = tUsers.Data[i]["Id"];
Input.SetText("Autores",scompany);
ComboBox.AddItem("ComboBox2",sName,sEmail);
end
else
ComboBox.AddItem("ComboBox2", "NOT LISTED", "");
ComboBox.SetSelected("ComboBox2", 1);
end
end
------
la otra seria de esta forma:
escribe esto en el ComboBox:
1 ItemText= Joven Investigador;
2 ItemText= Investigador
3 ItemText= Estudiante
1 ItemData = 1
2 ItemData = 2
3 1 ItemData = 3
luego en On Select ComboBox1
selected_index = ComboBox.GetSelected("Tipo Avutor");
-- Si el itms es selecionado , muestre un mensaje.
while (selected_index ~= -1) do
if (selected_index == 1) then
Page.Jump("Page2");
break;
end
if (selected_index == 2) then
Input.SetText("InTipo","Joven Investigador");
break;
end
if (selected_index == 3) then
Input.SetText("InTipo","Investigador");
break;
end
if (selected_index == 4) then
Input.SetText("InTipo","Estudiante");
break;
end
end
---
Espero que esto te sirva de algo, amigo
Powered by vBulletin™ Version 4.0.6 Copyright © 2012 vBulletin Solutions, Inc. All rights reserved.