如果值等于null SSRS,则返回0

时间:2018-01-13 01:08:30

标签: reporting-services ssrs-2012

我有这样的SSRS表达式:

null

如果表达式等于Format,我尝试显示0作为此问题的其他答案我尝试#,##0自定义数字属性为:if($product->is_type('variable')){ foreach($product->get_available_variations() as $variation ){ // Variation ID $variation_id = $variation['variation_id']; echo '<div class="product-variation variation-id-'.$variation_id.'"> <strong>Variation id</strong>: '.$variation_id.'<br>'; // Attributes $attributes = array(); foreach( $variation['attributes'] as $key => $value ){ $taxonomy = str_replace('attribute_', '', $key ); $taxonomy_label = get_taxonomy( $taxonomy )->labels->singular_name; $term_name = get_term_by( 'slug', $value, $taxonomy )->name; $attributes[] = $taxonomy_label.': '.$term_name; } echo '<span class="variation-attributes"> <strong>Attributes</strong>: '.implode( ' | ', $attributes ).'</span><br>'; // Prices $active_price = floatval($variation['display_price']); // Active price $regular_price = floatval($variation['display_regular_price']); // Regular Price if( $active_price != $regular_price ){ $sale_price = $active_price; // Sale Price } echo '<span class="variation-prices"> <strong>Price</strong>: '.$variation['price_html'].'</span><br> </div>'; } } ,但它不起作用。有人可以帮助我如何实现这一目标?此致

1 个答案:

答案 0 :(得分:0)

如果您正在测试null的整个表达式,那么您可能需要这样的东西..

{{1}}