Jump to content

rencarnacion

uniGUI Subscriber
  • Posts

    633
  • Joined

  • Last visited

  • Days Won

    14

Posts posted by rencarnacion

  1. You must generate a PDF and then you can load in the browser.

     

    You can check these function that I use in the DataModule :

     

    procedure TUniMainModule.Imprimir(ReporteSalida: TppReport);
    var
      lPDFDevice: TppPDFDevice;
      CacheFileName: string;
    begin
     
      // creat and configure the PDFDevice
      lPDFDevice := TppPDFDevice.Create(nil);
      CacheFileName := UniServerModule.LocalCachePath + FormatDateTime('hhmmsszzz',
        NOW) + 'Reporte.pdf';
     
      try
        lPDFDevice.PDFSettings := ReporteSalida.PDFSettings;
        lPDFDevice.FileName := CacheFileName; // assign output stream
        lPDFDevice.Publisher := ReporteSalida.Publisher;
     
        // generate the report
     
        ReporteSalida.PrintToDevices;
        UniSession.SendFile(CacheFileName);
      finally
        lPDFDevice.Free;
      end;
     
    end;
  2. Hello I'm having problem trying to change de Visible property of MainMenu Item.

     

    I had stored all the menu Item in table and I change these property in Create Form but It doesn't work .

     

     

     

    If You see something Wrong Please Let me know 

     

     

     

    Here the Code :

     

          for I := 0 to MainMenu.Items.Count -1 do
          begin
            with QryUuarioRoles, Parameters do
            begin
              Close ;
              ParamByName('Menu_Opcion').Value := MainMenu.Items.Name;
              ParamByName('ProfileID').Value := UniMainModule.Gv_Profile;
     
              Open;
              if eof then
                 MainMenu.Items.Visible := False
              else
              MainMenu.Items.Visible := True;
            end;
     
                  if  MainMenu.Items.Count  > 0 then
            begin
     
             for J := 0 to MainMenu.Items.Count -1 do
             begin
     
                with QryUuarioRoles, Parameters do
                begin
                 Close ;
                 ParamByName('Menu_Opcion').Value := MainMenu.Items.Name;
                 ParamByName('ProfileID').Value := UniMainModule.Gv_Profile;
     
                 Open;
                 if eof then
                    MainMenu.Items.Items[j].Visible := False
                 else
                    MainMenu.Items.Items[j].Visible := True;
                 end;
     
               if MainMenu.Items.Items[j].Count >0  then
                begin
     
                for K := 0 to MainMenu.Items.Items[j].Count -1 do
                begin
     
                with QryUuarioRoles, Parameters do
                begin
                 Close ;
                 ParamByName('Menu_Opcion').Value := MainMenu.Items.Items[j].Items[K].Name;
                 ParamByName('ProfileID').Value := UniMainModule.Gv_Profile;
                 Open;
                 if eof then
                    MainMenu.Items.Items[j].Items[K].Visible := False
                 else
                    MainMenu.Items.Items[j].Items[K].Visible := True;
                 end;
     
     
                end;
               end;
     
             end;
            end;
          end;
     

     

  3. Is There a way to get a MainMenu  Item name as I can get the Caption of Item ?

     

    Example:

     

    for I := 0 to MainMenu.Items.Count -1 do

    begin

             MemoItem.Lines.add(Mainmenu.Items.name;

    end;

     

    I thought that was MainMenu.Items.Name

     

    Thanks 

     

×
×
  • Create New...