query

Questionsquery
pascal asked 10 years ago

hello I cannot export date and time to the pdf.

$col = array();

$col["title"] = "Receive Date";
$col["name"] = "receive_date";
$col["width"] = "50";
$col["formoptions"] = array("rowpos"=>"1", "colpos"=>"2");
$col["searchoptions"]["sopt"] = array("cn"); // contains search for easy searching
# to make it date time
$col["formatter"] = "date";
# opts array can have these options: http://trentrichardson.com/examples/timepicker/#tp-options
$col["formatoptions"] = array("srcformat"=>'Y-m-d',"newformat"=>'Y-m-d',"opts" => array("timeFormat"=>""));
$col["show"] = array("list"=>true, "add"=>true, "edit"=>true, "view"=>true);
$col["export"] = true;
$cols[] = $col;

$col = array();
$col["title"] = "Time";
$col["name"] = "receive_date";
$col["width"] = "50";
$col["formoptions"] = array("rowpos"=>"1", "colpos"=>"2");
$col["searchoptions"]["sopt"] = array("cn"); // contains search for easy searching
# to make it date time
$col["formatter"] = "date";
# opts array can have these options: http://trentrichardson.com/examples/timepicker/#tp-options
$col["formatoptions"] = array("srcformat"=>'Y-m-d H:i:s',"newformat"=>'H:i:s',"opts" => array("timeFormat"=>""));
$col["show"] = array("list"=>true, "add"=>true, "edit"=>true, "view"=>true);
$col["export"] = true;
$cols[] = $col;
$col = array();

2 Answers
Abu Ghufran answered 10 years ago

For displaying / export 2 columns with same field, you will need to alias this field again in select_command

$g->select_command = "SELECT i.id, receive_date,receive_date as receive_time, … FROM invheader";

And then use receive_time for second column.

Abu Ghufran answered 10 years ago

The aliased field will not be editable and may need custom on_update code for update.

Your Answer

0 + 17 =

Login with your Social Id:

OR, enter

Attach code here and paste link in question.
Attach screenshot here and paste link in question.



How useful was this discussion?

Click on a star to rate it!

Average rating 0 / 5. Vote count: 0

No votes so far! Be the first to rate it.

We are sorry that this post was not useful for you!

Let us improve this post!

Tell us how we can improve this post?