Jump to content

SayeyeZohor

uniGUI Subscriber
  • Posts

    215
  • Joined

  • Last visited

Posts posted by SayeyeZohor

  1. 7 hours ago, delagoutte said:

    exemple :

    
    myquery1.sql.text := 'select filed1, field2, field3 from mytable';
    myquery = fdquery that is linked to a datasaource that is linked to my grid.
    visiblefield.text := 'field3'+#13#10+'field2';  // it is a tstringlist, only field2 and field3 are visible on my grid and the order in the list is the order in the grid
    
        for i:= 0 to GenQuery1.FieldCount-1 do
        begin
          if (VisibleField.IndexOf(UpperCase(GenQuery1.Fields[i].FieldName))<>-1) then
          begin
            GenQuery1.Fields[i].Visible := True;
          end
          else
          begin
            GenQuery1.Fields[i].Visible := false;
          end;
        end;
    // if a field is not visible , it is not exported
    //reorder column in same order that in the grid
        for i := 0 to VisibleField.Count-1 do
        begin
          if GenQuery1.FieldDefs.IndexOf(VisibleField.Strings[i])<>-1 then
          begin
            GenQuery1.FieldByName(VisibleField.Strings[i]).Index := i;
          end;
        end;

     

    myquery1
    myquery
    GenQuery1

    What are these?

  2. 1 hour ago, delagoutte said:

    i use a tstringlist with all field that are visible in the grid 

    After, i modify the dataset with a code like this :

    
    MyQuery.Fields[i].Visible := (VisibleField.IndexOf(UpperCase(MyQuery.Fields[i].FieldName))<>-1);

     

    proposable because you open directly the file from you browser- > excel open the files in protected mode 

    proposable because you open directly the file from you browser- > excel open the files in protected mode 

     

    No it's not

  3. On 11/29/2016 at 12:50 PM, delagoutte said:

    i use it with dataset. and for column title i use Mydataset.Fields.DisplayLabel := myTitleColumn

    if you deploy as dll. don't forget :

    SMExport.Options:=SMExport.Options-[soShowMessage];

    SMExport.AnimatedStatus:=false;

     

    sample of my export function :

    
    function TExportAO.SaveToXls : boolean;
    var
      SMExport: TSMExportToXLS;
    begin
      result:=false;
      SMExport := TSMExportToXLS.Create(nil);
      try
        SMExport.AnimatedStatus:=false;
        SMExport.Options:=SMExport.Options-[soShowMessage];
        SMExport.DataSet:= GenQuery1;//genquery1 is a fdquery i use firedac
        SMExport.ColumnSource := csDataSet;
        SMExport.AddTitle := True;
        SMExport.FileName := fFileName;
        SMExport.KeyGenerator:='My Company Name';
        GenTitleLabel;//this function set displaylabel for each column
        SMExport.Execute;
        result := (SMExport.ExportResult = erCompleted);
      finally
        SMExport.Free;
      end;
    end;

    hi, tnx

     

    1- How to export only fields that are visible in DbGrid?

    2- Why can't they be edited in Excel after being exported?

     

    image.thumb.png.14cb8a15466a188b36964e2669594b46.png

     

     

  4. 1 hour ago, Sherzod said:

    Hi,

    There may be a problem with using third-party components too. You can use Eurekalog, MadExcept, FastMM4 to find a memory leaks.

    C:\Program Files (x86)\FMSoft\Framework\unigui\unipackages-6.7.0\themes\ext-theme-uni_win7\resources\images\button\arrow-rtl.png

    this error in log file

  5. On 8/26/2019 at 1:47 PM, Sherzod said:

    Hi,

    You can try this:

    1. UniServerModule.Options -> soDontLoadJQueryLib = True

    2. UniServerModule.CustomFiles -> Add your version of JQuery...

    I Changed to the jQuery version, but that happened to my form

     

    image.thumb.png.90cad03b3b6659b7949262a24ed82cf1.png

     

    image.png.79dc390bb6385381841d22dede9e5953.png

  6. 7 minutes ago, Sherzod said:

    Can you try another solution?

    1. Remove:

    
    function menushow(sender, menu, eOpts)
    {
        /*var me=sender.menu;
        if (me) {
            me.setWidth(sender.getWidth());
            me.items.each(function(item){
                item.setMinWidth(sender.getWidth()-6)
            });
        }*/
    }

    2. 

    
    type
      TXPopupMenu = class(TUniPopupMenu)
    
      end;

    3. UniFormReady event:

    
    procedure TMainForm.UniFormReady(Sender: TObject);
    begin
      with TXPopupMenu(UniPopupMenu1).MenuControl.JSInterface do
        JSConfig('minWidth', [UniMenuButton1.Width-6]);
     
    end;

     

    tnxxxxxxxxxxxxxxxxx

    • Like 1
  7. 33 minutes ago, Sherzod said:

    One of the possible solutions for now:

    UniMenuButton1.ClientEvents.ExtEvents -> 

    
    function menushow(sender, menu, eOpts)
    {
        var me=sender.menu;
        if (me) {
            me.setWidth(sender.getWidth());
            me.items.each(function(item){
                item.setMinWidth(sender.getWidth()-6)
            });
        }
    }

     

    It is displayed the first time and then corrected...

    image.png.9ac742039bcafd116e0e9b8ac5c00324.png

     

    and then fix

    image.png.907d29b3322de91db83dbcb5900820e2.png

     

    function menushow(sender, menu, eOpts)  --- > menubeforeshow ? ???????????

     

×
×
  • Create New...