Hi,
I have been pounding on this for 3 days already, trying to get the positions figured out
I am created an added pdf page with only 2 fields and a page break.
Page break is set to break after 3
( i have 6 submission of data) what i should be getting is 2 pages. 3 per page
If my first field is set to "field self" the second page data is on top of page 1
and if i set the first field to "last writing position" the data is populated correctly, 3 on one page and 3 on the other, BUT the margins are off.
the 2nd page continues with the margins from the first page. if i print them out and overlay them i can see that the position on the 2nd page continues after the first page. This would make sense because "last writing position" shouldn't work for the first field.
But if i make the first field anything but " last wp" it doesn't work
i searched the entire forum and read everything and tried everything.
please help
/* Display: PDF Page 2 */
$handler = $view->new_display('pdf', 'PDF Page 2', 'pdf_2');
$handler->display->display_options['pager']['type'] = 'some';
$handler->display->display_options['style_plugin'] = 'pdf_unformatted';
$handler->display->display_options['row_plugin'] = 'pdf_fields';
$handler->display->display_options['row_options']['formats'] = array(
'civicrm_1_activity_1_cg3_custom_6' => array(
'position' => array(
'object' => 'last_position',
'corner' => 'top_left',
'x' => '',
'y' => '',
'width' => '',
'height' => '',
),
'text' => array(
'font_size' => '',
'font_family' => 'default',
'font_style' => array(
'b' => 0,
'i' => 0,
'u' => 0,
'd' => 0,
'o' => 0,
),
'align' => NULL,
'hyphenate' => NULL,
'color' => '',
),
'render' => array(
'is_html' => 1,
'minimal_space' => '1',
'eval_before' => '',
'bypass_eval_before' => 0,
'eval_after' => '',
'bypass_eval_after' => 0,
),
),
'civicrm_1_activity_1_cg3_custom_6_timepart' => array(
'position' => array(
'object' => 'field_civicrm_1_activity_1_cg3_custom_6',
'corner' => 'top_left',
'x' => '50',
'y' => '',
'width' => '',
'height' => '',
),
'text' => array(
'font_size' => '',
'font_family' => 'default',
'font_style' => array(
'b' => 0,
'i' => 0,
'u' => 0,
'd' => 0,
'o' => 0,
),
'align' => NULL,
'hyphenate' => NULL,
'color' => '',
),
'render' => array(
'is_html' => 1,
'minimal_space' => '1',
'eval_before' => '',
'bypass_eval_before' => 0,
'eval_after' => '',
'bypass_eval_after' => 0,
),
),
'page_break' => array(
'position' => array(
'object' => 'last_position',
'corner' => 'bottom_left',
'x' => '',
'y' => '10',
'width' => '',
'height' => '',
),
'text' => array(
'font_size' => '',
'font_family' => 'default',
'font_style' => array(
'b' => 0,
'i' => 0,
'u' => 0,
'd' => 0,
'o' => 0,
),
'align' => NULL,
'hyphenate' => NULL,
'color' => '',
),
'render' => array(
'is_html' => 1,
'minimal_space' => '1',
'eval_before' => '',
'bypass_eval_before' => 0,
'eval_after' => '',
'bypass_eval_after' => 0,
),
),
);
$handler->display->display_options['row_options']['leading_template'] = '0';
$handler->display->display_options['row_options']['template'] = '0';
$handler->display->display_options['row_options']['succeed_template'] = '0';
$handler->display->display_options['defaults']['fields'] = FALSE;
/* Field: Webform views 2013 ei session notes v2 6: Sid */
$handler->display->display_options['fields']['sid']['id'] = 'sid';
$handler->display->display_options['fields']['sid']['table'] = 'webform_views_2013_ei_session_notes_v2_6';
$handler->display->display_options['fields']['sid']['field'] = 'sid';
$handler->display->display_options['fields']['sid']['label'] = 'sid';
$handler->display->display_options['fields']['sid']['exclude'] = TRUE;
/* Field: Webform views 2013 ei session notes v2 6: Uid */
$handler->display->display_options['fields']['uid']['id'] = 'uid';
$handler->display->display_options['fields']['uid']['table'] = 'webform_views_2013_ei_session_notes_v2_6';
$handler->display->display_options['fields']['uid']['field'] = 'uid';
$handler->display->display_options['fields']['uid']['label'] = 'uid';
$handler->display->display_options['fields']['uid']['exclude'] = TRUE;
/* Field: Webform views 2013 ei session notes v2 6: Civicrm 1 contact 1 contact contact id */
$handler->display->display_options['fields']['civicrm_1_contact_1_contact_contact_id']['id'] = 'civicrm_1_contact_1_contact_contact_id';
$handler->display->display_options['fields']['civicrm_1_contact_1_contact_contact_id']['table'] = 'webform_views_2013_ei_session_notes_v2_6';
$handler->display->display_options['fields']['civicrm_1_contact_1_contact_contact_id']['field'] = 'civicrm_1_contact_1_contact_contact_id';
$handler->display->display_options['fields']['civicrm_1_contact_1_contact_contact_id']['label'] = 'civicrm_1_contact_1_contact_contact_id';
$handler->display->display_options['fields']['civicrm_1_contact_1_contact_contact_id']['exclude'] = TRUE;
/* Field: Webform views 2013 ei session notes v2 6: Civicrm 1 activity 1 cg3 custom 6 */
$handler->display->display_options['fields']['civicrm_1_activity_1_cg3_custom_6']['id'] = 'civicrm_1_activity_1_cg3_custom_6';
$handler->display->display_options['fields']['civicrm_1_activity_1_cg3_custom_6']['table'] = 'webform_views_2013_ei_session_notes_v2_6';
$handler->display->display_options['fields']['civicrm_1_activity_1_cg3_custom_6']['field'] = 'civicrm_1_activity_1_cg3_custom_6';
$handler->display->display_options['fields']['civicrm_1_activity_1_cg3_custom_6']['label'] = 'Service Date';
$handler->display->display_options['fields']['civicrm_1_activity_1_cg3_custom_6']['element_label_colon'] = FALSE;
/* Field: Webform views 2013 ei session notes v2 6: Civicrm 1 activity 1 cg3 custom 6 timepart */
$handler->display->display_options['fields']['civicrm_1_activity_1_cg3_custom_6_timepart']['id'] = 'civicrm_1_activity_1_cg3_custom_6_timepart';
$handler->display->display_options['fields']['civicrm_1_activity_1_cg3_custom_6_timepart']['table'] = 'webform_views_2013_ei_session_notes_v2_6';
$handler->display->display_options['fields']['civicrm_1_activity_1_cg3_custom_6_timepart']['field'] = 'civicrm_1_activity_1_cg3_custom_6_timepart';
$handler->display->display_options['fields']['civicrm_1_activity_1_cg3_custom_6_timepart']['label'] = '';
$handler->display->display_options['fields']['civicrm_1_activity_1_cg3_custom_6_timepart']['element_label_colon'] = FALSE;
/* Field: PDF: Page Break */
$handler->display->display_options['fields']['page_break']['id'] = 'page_break';
$handler->display->display_options['fields']['page_break']['table'] = 'pdf';
$handler->display->display_options['fields']['page_break']['field'] = 'page_break';
$handler->display->display_options['fields']['page_break']['label'] = 'Page Break here';
$handler->display->display_options['fields']['page_break']['element_label_colon'] = FALSE;
$handler->display->display_options['fields']['page_break']['last_row'] = 0;
$handler->display->display_options['fields']['page_break']['every_nth'] = '3';
$handler->display->display_options['path'] = 'notes2';
$handler->display->display_options['default_page_format'] = 'custom';
$handler->display->display_options['default_page_format_custom'] = '[8.5"]x[11"]';
$handler->display->display_options['margin_left'] = '0';
$handler->display->display_options['margin_right'] = '0';
$handler->display->display_options['margin_top'] = '0';
$handler->display->display_options['margin_bottom'] = '0';
Comments
Comment #1
cousimo commentedfollow up question:
If i have 3 nodes displayed on one page..
can i have row 1 on an xy and row 2 on another xy etc.
Comment #2
vegansupreme commentedCousimo,
Could you post a picture/diagram of what's happening? That view won't import for me. I don't have Civicrm or web form views installed.
I would think you should be able to get 3 items per page.
If you want to try using PHP for positioning, this issue has a lot of information.
#1345182: Positioning Field Output for Columns
Comment #3
cousimo commentedHi Vegansupreme,
Thank you for your response, i was able to achieve alot of my results using the link you posted and customizing the positions of the x and y.
My 2 issues now is as follows
I have 2 records per page and have the pdf page break set to 2.
If my records in the total results is an even number 2, 4, 6 the page breaks after record 1 ,
Page 1 will have record 1
page 2 will have record 2 & 3
page 4 will have record 3 & 4
how do i get record 2page to page 1?
2nd issue is , if i my total records is an odd number then all the records end up on the first page overwriting eachother.
thank you for all your help
Comment #4
vegansupreme commentedCousimo,
Can you post the code you're using?
Comment #5
cousimo commentedComment #6
cousimo commentedThis solved my issue , thank you your help
Comment #7
vegansupreme commentedGlad to help! Is this fixed for you?
Comment #8
vegansupreme commentedComment #9
cousimo commentedyes thank you